aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
Diffstat (limited to 'routers')
-rw-r--r--routers/web/repo/compare.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go
index c49eb762d8..92abe0ce25 100644
--- a/routers/web/repo/compare.go
+++ b/routers/web/repo/compare.go
@@ -551,7 +551,11 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
ctx.ServerError("GetCompareInfo", err)
return nil
}
- ctx.Data["BeforeCommitID"] = ci.CompareInfo.MergeBase
+ if ci.DirectComparison {
+ ctx.Data["BeforeCommitID"] = ci.CompareInfo.BaseCommitID
+ } else {
+ ctx.Data["BeforeCommitID"] = ci.CompareInfo.MergeBase
+ }
return ci
}