Make API "compare" accept commit IDs (#32801)

This commit is contained in:
wxiaoguang 2024-12-12 16:10:09 +08:00 committed by GitHub
parent 01b1896bf5
commit 22bf2ca6ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 154 additions and 124 deletions

View file

@ -142,7 +142,6 @@ func (ref RefName) RemoteName() string {
// ShortName returns the short name of the reference name
func (ref RefName) ShortName() string {
refName := string(ref)
if ref.IsBranch() {
return ref.BranchName()
}
@ -158,8 +157,7 @@ func (ref RefName) ShortName() string {
if ref.IsFor() {
return ref.ForBranchName()
}
return refName
return string(ref) // usually it is a commit ID
}
// RefGroup returns the group type of the reference