From 46c7fe371d09ecb2f9d6043286bbb33f124ecceb Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Mon, 29 Jan 2018 03:18:20 -0700 Subject: [PATCH] Fix PR merge error (#3421) --- models/pull.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/models/pull.go b/models/pull.go index 45fe852e9fd..15b3a4fe185 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