Skip to content

Commit

Permalink
Fix PR merge error (go-gitea#3421)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethantkoenig authored and lafriks committed Jan 29, 2018
1 parent 28b8189 commit 46c7fe3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions models/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 46c7fe3

Please sign in to comment.