Skip to content

Commit 766460c

Browse files
committed
Fix 2-dot direct compare to use the right base commit
1 parent b4e9525 commit 766460c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

routers/web/repo/compare.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,11 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
551551
ctx.ServerError("GetCompareInfo", err)
552552
return nil
553553
}
554-
ctx.Data["BeforeCommitID"] = ci.CompareInfo.MergeBase
554+
if ci.DirectComparison {
555+
ctx.Data["BeforeCommitID"] = ci.CompareInfo.BaseCommitID
556+
} else {
557+
ctx.Data["BeforeCommitID"] = ci.CompareInfo.MergeBase
558+
}
555559

556560
return ci
557561
}

0 commit comments

Comments
 (0)