Merge branch 'main' into lunny/some_refactors

This commit is contained in:
Lunny Xiao committed 2026-01-02 18:58:21 -08:00
commit f9d77d7501
21 files changed
+332 -492

No files matched your search

+11
View File
@@ -220,3 +220,14 @@ func (ref RefName) RefWebLinkPath() string {
}
return string(refType) + "/" + util.PathEscapeSegments(ref.ShortName())
}
func ParseRefSuffix(ref string) (string, string) {
// Partially support https://git-scm.com/docs/gitrevisions
if idx := strings.Index(ref, "@{"); idx != -1 {
return ref[:idx], ref[idx:]
}
if idx := strings.Index(ref, "^"); idx != -1 {
return ref[:idx], ref[idx:]
}
return ref, ""
}