summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/pull.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/pull.go')
-rw-r--r--routers/web/repo/pull.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go
index ba775d761b..1a6a5e55e6 100644
--- a/routers/web/repo/pull.go
+++ b/routers/web/repo/pull.go
@@ -325,13 +325,13 @@ func PrepareMergedViewPullInfo(ctx *context.Context, issue *models.Issue) *git.C
if pull.MergeBase == "" {
var commitSHA, parentCommit string
// If there is a head or a patch file, and it is readable, grab info
- commitSHA, err := ctx.Repo.GitRepo.ReadPullHead(pull.Index)
+ commitSHA, err := ctx.Repo.GitRepo.GetRefCommitID(pull.GetGitRefName())
if err != nil {
// Head File does not exist, try the patch
commitSHA, err = ctx.Repo.GitRepo.ReadPatchCommit(pull.Index)
if err == nil {
// Recreate pull head in files for next time
- if err := ctx.Repo.GitRepo.WritePullHead(pull.Index, commitSHA); err != nil {
+ if err := ctx.Repo.GitRepo.SetReference(pull.GetGitRefName(), commitSHA); err != nil {
log.Error("Could not write head file", err)
}
} else {