MCPcopy Create free account
hub / github.com/go-git/go-git / GetIndexByHash

Method GetIndexByHash

plumbing/format/commitgraph/memory.go:28–35  ·  view source on GitHub ↗

GetIndexByHash gets the index in the commit graph from commit hash, if available

(h plumbing.Hash)

Source from the content-addressed store, hash-verified

26
27// GetIndexByHash gets the index in the commit graph from commit hash, if available
28func (mi *MemoryIndex) GetIndexByHash(h plumbing.Hash) (int, error) {
29 i, ok := mi.indexMap[h]
30 if ok {
31 return i, nil
32 }
33
34 return 0, plumbing.ErrObjectNotFound
35}
36
37// GetCommitDataByIndex gets the commit node from the commit graph using index
38// obtained from child node, if available

Callers 1

GetCommitDataByIndexMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected