MCPcopy
hub / github.com/git-lfs/git-lfs / IsZeroObjectID

Function IsZeroObjectID

git/git.go:141–148  ·  view source on GitHub ↗

IsZeroObjectID returns true if the string is a valid hexadecimal Git object ID and represents the all-zeros object ID for some hash algorithm.

(s string)

Source from the content-addressed store, hash-verified

139// IsZeroObjectID returns true if the string is a valid hexadecimal Git object
140// ID and represents the all-zeros object ID for some hash algorithm.
141func IsZeroObjectID(s string) bool {
142 for _, length := range ObjectIDLengths {
143 if s == strings.Repeat("0", length) {
144 return true
145 }
146 }
147 return false
148}
149
150func EmptyTree() (string, error) {
151 emptyTreeMutex.Lock()

Callers 5

prePushRefsFunction · 0.92
blobInfoFromFunction · 0.92
blobInfoFunction · 0.92
nonZeroShasFunction · 0.85
TestIsZeroObjectIDFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsZeroObjectIDFunction · 0.68