File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -410,6 +410,12 @@ func RepoIDAssignment() func(ctx *Context) {
410
410
411
411
// RepoAssignment returns a middleware to handle repository assignment
412
412
func RepoAssignment (ctx * Context ) (cancel context.CancelFunc ) {
413
+ if _ , repoAssignmentOnce := ctx .Data ["repoAssignmentExecuted" ]; repoAssignmentOnce {
414
+ log .Trace ("RepoAssignment was exec already, skipping second call ..." )
415
+ return
416
+ }
417
+ ctx .Data ["repoAssignmentExecuted" ] = true
418
+
413
419
var (
414
420
owner * user_model.User
415
421
err error
@@ -596,6 +602,9 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) {
596
602
ctx .ServerError ("RepoAssignment Invalid repo " + repo_model .RepoPath (userName , repoName ), err )
597
603
return
598
604
}
605
+ if ctx .Repo .GitRepo != nil {
606
+ ctx .Repo .GitRepo .Close ()
607
+ }
599
608
ctx .Repo .GitRepo = gitRepo
600
609
601
610
// We opened it, we should close it
You can’t perform that action at this time.
0 commit comments