summaryrefslogtreecommitdiffstats
path: root/routers/repo/pull.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/pull.go')
-rw-r--r--routers/repo/pull.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index 8269717e57..67849f33e1 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -352,6 +352,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.Compare
ctx.ServerError("OpenRepository", err)
return nil
}
+ defer headGitRepo.Close()
headBranchExist = headGitRepo.IsBranchExist(pull.HeadBranch)
@@ -534,6 +535,7 @@ func ViewPullFiles(ctx *context.Context) {
ctx.ServerError("OpenRepository", err)
return
}
+ defer headGitRepo.Close()
headCommitID, err := headGitRepo.GetBranchCommitID(pull.HeadBranch)
if err != nil {
@@ -748,6 +750,7 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm)
if ctx.Written() {
return
}
+ defer headGitRepo.Close()
labelIDs, assigneeIDs, milestoneID := ValidateRepoMetas(ctx, form, true)
if ctx.Written() {
@@ -913,12 +916,14 @@ func CleanUpPullRequest(ctx *context.Context) {
ctx.ServerError(fmt.Sprintf("OpenRepository[%s]", pr.HeadRepo.RepoPath()), err)
return
}
+ defer gitRepo.Close()
gitBaseRepo, err := git.OpenRepository(pr.BaseRepo.RepoPath())
if err != nil {
ctx.ServerError(fmt.Sprintf("OpenRepository[%s]", pr.BaseRepo.RepoPath()), err)
return
}
+ defer gitBaseRepo.Close()
defer func() {
ctx.JSON(200, map[string]interface{}{
@@ -1047,6 +1052,7 @@ func DownloadPullPatch(ctx *context.Context) {
ctx.ServerError("OpenRepository", err)
return
}
+ defer headGitRepo.Close()
patch, err := headGitRepo.GetFormatPatch(pr.MergeBase, pr.HeadBranch)
if err != nil {