aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/pull.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/pull.go')
-rw-r--r--routers/web/repo/pull.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go
index 6e83a72c24..8ff2ddf394 100644
--- a/routers/web/repo/pull.go
+++ b/routers/web/repo/pull.go
@@ -1024,10 +1024,14 @@ func CompareAndPullRequestPost(ctx *context.Context) {
)
headUser, headRepo, headGitRepo, prInfo, baseBranch, headBranch := ParseCompareInfo(ctx)
+ defer func() {
+ if headGitRepo != nil {
+ headGitRepo.Close()
+ }
+ }()
if ctx.Written() {
return
}
- defer headGitRepo.Close()
labelIDs, assigneeIDs, milestoneID, _ := ValidateRepoMetas(ctx, *form, true)
if ctx.Written() {