summaryrefslogtreecommitdiffstats
path: root/models/pull.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/pull.go')
-rw-r--r--models/pull.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/models/pull.go b/models/pull.go
index fa9a44897a..64b347554c 100644
--- a/models/pull.go
+++ b/models/pull.go
@@ -339,9 +339,6 @@ var patchConflicts = []string{
// testPatch checks if patch can be merged to base repository without conflit.
// FIXME: make a mechanism to clean up stable local copies.
func (pr *PullRequest) testPatch() (err error) {
- repoWorkingPool.CheckIn(com.ToStr(pr.BaseRepoID))
- defer repoWorkingPool.CheckOut(com.ToStr(pr.BaseRepoID))
-
if pr.BaseRepo == nil {
pr.BaseRepo, err = GetRepositoryByID(pr.BaseRepoID)
if err != nil {
@@ -360,6 +357,9 @@ func (pr *PullRequest) testPatch() (err error) {
return nil
}
+ repoWorkingPool.CheckIn(com.ToStr(pr.BaseRepoID))
+ defer repoWorkingPool.CheckOut(com.ToStr(pr.BaseRepoID))
+
log.Trace("PullRequest[%d].testPatch (patchPath): %s", pr.ID, patchPath)
if err := pr.BaseRepo.UpdateLocalCopyBranch(pr.BaseBranch); err != nil {