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

Function NewMemoryIndex

plumbing/format/commitgraph/memory.go:21–25  ·  view source on GitHub ↗

NewMemoryIndex creates in-memory commit graph representation Deprecated: This package uses the wrong types for Generation and Index in CommitData. Use the v2 package instead.

()

Source from the content-addressed store, hash-verified

19// Deprecated: This package uses the wrong types for Generation and Index in CommitData.
20// Use the v2 package instead.
21func NewMemoryIndex() *MemoryIndex {
22 return &MemoryIndex{
23 indexMap: make(map[plumbing.Hash]int),
24 }
25}
26
27// GetIndexByHash gets the index in the commit graph from commit hash, if available
28func (mi *MemoryIndex) GetIndexByHash(h plumbing.Hash) (int, error) {

Callers 1

TestReencodeInMemoryMethod · 0.92

Calls

no outgoing calls

Tested by 1

TestReencodeInMemoryMethod · 0.74