Files
buildkit/util/gitutil/git_commit.go
Tonis Tiigi 4645296cb7 git: add sha256 commits support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-09-05 16:34:55 -07:00

20 lines
264 B
Go

package gitutil
func IsCommitSHA(str string) bool {
if l := len(str); l != 40 && l != 64 {
return false
}
for _, ch := range str {
if ch >= '0' && ch <= '9' {
continue
}
if ch >= 'a' && ch <= 'f' {
continue
}
return false
}
return true
}