MCPcopy Index your code
hub / github.com/github/git-sizer / NewOID

Function NewOID

git/oid.go:30–36  ·  view source on GitHub ↗

NewOID converts an object ID in hex format (i.e., `[0-9a-f]{40}`) into an `OID`.

(s string)

Source from the content-addressed store, hash-verified

28// NewOID converts an object ID in hex format (i.e., `[0-9a-f]{40}`)
29// into an `OID`.
30func NewOID(s string) (OID, error) {
31 oidBytes, err := hex.DecodeString(s)
32 if err != nil {
33 return OID{}, err
34 }
35 return OIDFromBytes(oidBytes)
36}
37
38// String formats `oid` as a string in hex format.
39func (oid OID) String() string {

Callers 5

CreateObjectMethod · 0.92
ParseBatchHeaderFunction · 0.85
ParseReferenceFunction · 0.85
ParseTagFunction · 0.85
ParseCommitFunction · 0.85

Calls 1

OIDFromBytesFunction · 0.85

Tested by

no test coverage detected