Refactor RefName (#33234)

And fix some FIXMEs
This commit is contained in:
wxiaoguang authored and GitHub committed 2025-01-13 14:01:53 +08:00
1 parent 81352542fd
commit 2ea929a952
13 files changed
+58 -60

No files matched your search

+6 -2
View File
@@ -476,8 +476,12 @@ func (c *Commit) GetRepositoryDefaultPublicGPGKey(forceUpdate bool) (*GPGSetting
}
func IsStringLikelyCommitID(objFmt ObjectFormat, s string, minLength ...int) bool {
minLen := util.OptionalArg(minLength, objFmt.FullLength())
if len(s) < minLen || len(s) > objFmt.FullLength() {
maxLen := 64 // sha256
if objFmt != nil {
maxLen = objFmt.FullLength()
}
minLen := util.OptionalArg(minLength, maxLen)
if len(s) < minLen || len(s) > maxLen {
return false
}
for _, c := range s {