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)
| 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. |
| 141 | func 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 | |
| 150 | func EmptyTree() (string, error) { |
| 151 | emptyTreeMutex.Lock() |
no outgoing calls