MCPcopy
hub / github.com/go-git/go-git / NewHash

Function NewHash

plumbing/hash.go:26–33  ·  view source on GitHub ↗

NewHash return a new Hash from a hexadecimal hash representation

(s string)

Source from the content-addressed store, hash-verified

24
25// NewHash return a new Hash from a hexadecimal hash representation
26func NewHash(s string) Hash {
27 b, _ := hex.DecodeString(s)
28
29 var h Hash
30 copy(h[:], b)
31
32 return h
33}
34
35func (h Hash) IsZero() bool {
36 var empty Hash

Callers 15

TestNewLinesMethod · 0.92
TestBlameMethod · 0.92
mockBlameMethod · 0.92
TestLogMethod · 0.92
TestLogAllMethod · 0.92
TestLogAllOrderByTimeMethod · 0.92
TestLogHeadMethod · 0.92
TestLogErrorMethod · 0.92
TestLogFileNextMethod · 0.92
TestLogFileForEachMethod · 0.92
TestLogAllFileForEachMethod · 0.92

Calls

no outgoing calls

Tested by 15

TestNewLinesMethod · 0.74
TestBlameMethod · 0.74
mockBlameMethod · 0.74
TestLogMethod · 0.74
TestLogAllMethod · 0.74
TestLogAllOrderByTimeMethod · 0.74
TestLogHeadMethod · 0.74
TestLogErrorMethod · 0.74
TestLogFileNextMethod · 0.74
TestLogFileForEachMethod · 0.74
TestLogAllFileForEachMethod · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…