File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import (
10
10
"context"
11
11
"encoding/json"
12
12
"fmt"
13
- "path"
13
+ "path/filepath "
14
14
"strings"
15
15
"time"
16
16
@@ -421,6 +421,7 @@ func PushToBaseRepo(pr *models.PullRequest) (err error) {
421
421
if err != nil {
422
422
return fmt .Errorf ("OpenRepository: %v" , err )
423
423
}
424
+ defer gitRepo .Close ()
424
425
425
426
if err := pr .LoadBaseRepo (); err != nil {
426
427
log .Error ("Unable to load base repository for PR[%d] Error: %v" , pr .ID , err )
@@ -429,12 +430,11 @@ func PushToBaseRepo(pr *models.PullRequest) (err error) {
429
430
if err := gitRepo .AddRemote ("base" , pr .BaseRepo .RepoPath (), false ); err != nil {
430
431
return fmt .Errorf ("tmpGitRepo.AddRemote: %v" , err )
431
432
}
432
- defer gitRepo .Close ()
433
433
434
434
headFile := pr .GetGitRefName ()
435
435
436
436
// Remove head in case there is a conflict.
437
- file := path .Join (pr .BaseRepo .RepoPath (), headFile )
437
+ file := filepath .Join (pr .BaseRepo .RepoPath (), headFile )
438
438
439
439
_ = util .Remove (file )
440
440
You can’t perform that action at this time.
0 commit comments