MCPcopy
hub / github.com/github/git-sizer / RegisterTree

Method RegisterTree

sizes/graph.go:485–503  ·  view source on GitHub ↗

Record that the specified `oid` is the specified `tree`.

(oid git.OID, tree *git.Tree)

Source from the content-addressed store, hash-verified

483
484// Record that the specified `oid` is the specified `tree`.
485func (g *Graph) RegisterTree(oid git.OID, tree *git.Tree) error {
486 g.treeLock.Lock()
487
488 if _, ok := g.treeSizes[oid]; ok {
489 panic(fmt.Sprintf("tree %s registered twice!", oid))
490 }
491
492 // See if we already have a record for this tree:
493 record, ok := g.treeRecords[oid]
494 if !ok {
495 record = newTreeRecord(oid)
496 g.treeRecords[oid] = record
497 }
498
499 g.treeLock.Unlock()
500
501 // Let the record take care of the rest:
502 return record.initialize(g, oid, tree)
503}
504
505func (g *Graph) finalizeTreeSize(
506 oid git.OID, size TreeSize, objectSize counts.Count32, treeEntries counts.Count32,

Callers 1

ScanRepositoryUsingGraphFunction · 0.95

Calls 2

newTreeRecordFunction · 0.85
initializeMethod · 0.45

Tested by

no test coverage detected