mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-04 01:10:49 +01:00
Fix 2-dot direct compare to use the right base commit (#24133)
For 2-dot direct compare, we should use the base commit in the title and templates, as is used elsewhere, not the common ancestor which is used for 3-dot compare. I believe that this change should have been included in #22949.
This commit is contained in:
parent
fa3495183b
commit
1af3dc6ee3
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue