summaryrefslogtreecommitdiffstats
path: root/modules/repository/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/repository/init.go')
-rw-r--r--modules/repository/init.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/repository/init.go b/modules/repository/init.go
index c94b44514d..16012864b1 100644
--- a/modules/repository/init.go
+++ b/modules/repository/init.go
@@ -323,6 +323,7 @@ func initRepository(ctx models.DBContext, repoPath string, u *models.User, repo
if err != nil {
return fmt.Errorf("openRepository: %v", err)
}
+ defer gitRepo.Close()
if err = gitRepo.SetDefaultBranch(repo.DefaultBranch); err != nil {
return fmt.Errorf("setDefaultBranch: %v", err)
}