The `Require*Size` functions behave as follows: * If the size of the object with name `oid` is already known. In this case, return true as the second value. * If the size of the object is not yet known, then register the listener to be informed some time in the future when the size is known. In th
(oid git.OID)
| 440 | // known. In this case, return false as the second value. |
| 441 | |
| 442 | func (g *Graph) GetBlobSize(oid git.OID) BlobSize { |
| 443 | // See if we already know the size: |
| 444 | size, ok := g.blobSizes[oid] |
| 445 | if !ok { |
| 446 | panic("blob size not known") |
| 447 | } |
| 448 | return size |
| 449 | } |
| 450 | |
| 451 | func (g *Graph) RequireTreeSize(oid git.OID, listener func(TreeSize)) (TreeSize, bool) { |
| 452 | g.treeLock.Lock() |