1
1
mirror of https://github.com/go-gitea/gitea synced 2025-11-02 12:28:25 +00:00

Move GetDiverging functions to gitrepo (#35524)

Extracted from #35469

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Lunny Xiao
2025-09-26 08:15:42 -07:00
committed by GitHub
parent 8ad2a538da
commit 7bf2972379
16 changed files with 220 additions and 176 deletions

View File

@@ -126,8 +126,8 @@ func NewComment(ctx *context.Context) {
ctx.JSONError("The origin branch is delete, cannot reopen.")
return
}
headBranchRef := pull.GetGitHeadBranchRefName()
headBranchCommitID, err := git.GetFullCommitID(ctx, pull.HeadRepo.RepoPath(), headBranchRef)
headBranchRef := git.RefNameFromBranch(pull.HeadBranch)
headBranchCommitID, err := git.GetFullCommitID(ctx, pull.HeadRepo.RepoPath(), headBranchRef.String())
if err != nil {
ctx.ServerError("Get head commit Id of head branch fail", err)
return