Add adds new node to the memory index
(hash plumbing.Hash, commitData *CommitData)
| 69 | |
| 70 | // Add adds new node to the memory index |
| 71 | func (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 | } |
no outgoing calls