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

Method Add

plumbing/format/commitgraph/memory.go:71–78  ·  view source on GitHub ↗

Add adds new node to the memory index

(hash plumbing.Hash, commitData *CommitData)

Source from the content-addressed store, hash-verified

69
70// Add adds new node to the memory index
71func (mi *MemoryIndex) Add(hash plumbing.Hash, commitData *CommitData) {
72 // The parent indexes are calculated lazily in GetNodeByIndex
73 // which allows adding nodes out of order as long as all parents
74 // are eventually resolved
75 commitData.ParentIndexes = nil
76 mi.indexMap[hash] = len(mi.commitData)
77 mi.commitData = append(mi.commitData, commitData)
78}

Callers 2

TestMixedGraphMethod · 0.95
TestReencodeInMemoryMethod · 0.95

Calls

no outgoing calls

Tested by 2

TestMixedGraphMethod · 0.76
TestReencodeInMemoryMethod · 0.76