summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2018-01-29 03:18:20 -0700
committerLauris BH <lauris@nix.lv>2018-01-29 12:18:20 +0200
commit46c7fe371d09ecb2f9d6043286bbb33f124ecceb (patch)
tree1c520f53ab1c4a765bdd787b34715dde92a3ae38
parent28b81899d03301bdc9f7a9b453b7d467ee18ff8e (diff)
downloadgitea-46c7fe371d09ecb2f9d6043286bbb33f124ecceb.tar.gz
gitea-46c7fe371d09ecb2f9d6043286bbb33f124ecceb.zip
Fix PR merge error (#3421)
-rw-r--r--models/pull.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/models/pull.go b/models/pull.go
index 45fe852e9f..15b3a4fe18 100644
--- a/models/pull.go
+++ b/models/pull.go
@@ -298,10 +298,6 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository, mergeStyle
}()
headRepoPath := RepoPath(pr.HeadUserName, pr.HeadRepo.Name)
- headGitRepo, err := git.OpenRepository(headRepoPath)
- if err != nil {
- return fmt.Errorf("OpenRepository: %v", err)
- }
// Clone base repo.
tmpBasePath := path.Join(LocalCopyPath(), "merge-"+com.ToStr(time.Now().Nanosecond())+".git")
@@ -441,7 +437,7 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository, mergeStyle
return nil
}
- l, err := headGitRepo.CommitsBetweenIDs(pr.MergedCommitID, pr.MergeBase)
+ l, err := baseGitRepo.CommitsBetweenIDs(pr.MergedCommitID, pr.MergeBase)
if err != nil {
log.Error(4, "CommitsBetweenIDs: %v", err)
return nil