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

This commit is contained in:
wxiaoguang authored and GitHub committed 2024-12-12 08:10:09 +00:00
1 parent 01b1896bf5
commit 22bf2ca6ba
10 files changed
+154 -124

No files matched your search

+1 -3
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