Record that the specified `oid` is the specified `tree`.
(oid git.OID, tree *git.Tree)
| 483 | |
| 484 | // Record that the specified `oid` is the specified `tree`. |
| 485 | func (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 | |
| 505 | func (g *Graph) finalizeTreeSize( |
| 506 | oid git.OID, size TreeSize, objectSize counts.Count32, treeEntries counts.Count32, |
no test coverage detected