mirror of https://github.com/go-gitea/gitea.git
Close git repo earlier
This commit is contained in:
parent
c1eac83e59
commit
3ec275303d
|
@ -120,9 +120,9 @@ func StartPullRequestAutoMergeCheck(ctx context.Context, pull *issues_model.Pull
|
||||||
log.Error("OpenRepository: %v", err)
|
log.Error("OpenRepository: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer gitRepo.Close()
|
|
||||||
|
|
||||||
commitID, err := gitRepo.GetRefCommitID(pull.GetGitRefName())
|
commitID, err := gitRepo.GetRefCommitID(pull.GetGitRefName())
|
||||||
|
gitRepo.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("GetRefCommitID: %v", err)
|
log.Error("GetRefCommitID: %v", err)
|
||||||
return
|
return
|
||||||
|
@ -136,9 +136,9 @@ func getPullRequestsByHeadSHA(ctx context.Context, sha string, repo *repo_model.
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer gitRepo.Close()
|
|
||||||
|
|
||||||
refs, err := gitRepo.GetRefsBySha(sha, "")
|
refs, err := gitRepo.GetRefsBySha(sha, "")
|
||||||
|
gitRepo.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue