mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-27 04:07:08 +00:00
Restore detection of branches are equal on compare page (#14586)
Somehow the test for detecting if branches are equal broke this PR restores this functionality. Fix #14502 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
ebddee8d2b
commit
66a148e398
2 changed files with 18 additions and 27 deletions
|
@ -423,18 +423,7 @@ func PrepareCompareDiff(
|
|||
// Get diff information.
|
||||
ctx.Data["CommitRepoLink"] = headRepo.Link()
|
||||
|
||||
headCommitID := headBranch
|
||||
if ctx.Data["HeadIsCommit"] == false {
|
||||
if ctx.Data["HeadIsTag"] == true {
|
||||
headCommitID, err = headGitRepo.GetTagCommitID(headBranch)
|
||||
} else {
|
||||
headCommitID, err = headGitRepo.GetBranchCommitID(headBranch)
|
||||
}
|
||||
if err != nil {
|
||||
ctx.ServerError("GetRefCommitID", err)
|
||||
return false
|
||||
}
|
||||
}
|
||||
headCommitID := compareInfo.HeadCommitID
|
||||
|
||||
ctx.Data["AfterCommitID"] = headCommitID
|
||||
|
||||
|
@ -460,18 +449,7 @@ func PrepareCompareDiff(
|
|||
}
|
||||
|
||||
baseGitRepo := ctx.Repo.GitRepo
|
||||
baseCommitID := baseBranch
|
||||
if ctx.Data["BaseIsCommit"] == false {
|
||||
if ctx.Data["BaseIsTag"] == true {
|
||||
baseCommitID, err = baseGitRepo.GetTagCommitID(baseBranch)
|
||||
} else {
|
||||
baseCommitID, err = baseGitRepo.GetBranchCommitID(baseBranch)
|
||||
}
|
||||
if err != nil {
|
||||
ctx.ServerError("GetRefCommitID", err)
|
||||
return false
|
||||
}
|
||||
}
|
||||
baseCommitID := compareInfo.BaseCommitID
|
||||
|
||||
baseCommit, err := baseGitRepo.GetCommit(baseCommitID)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue