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

Method RegisterBlob

sizes/graph.go:419–431  ·  view source on GitHub ↗

RegisterBlob records that the specified `oid` is a blob with the specified size.

(oid git.OID, objectSize counts.Count32)

Source from the content-addressed store, hash-verified

417// RegisterBlob records that the specified `oid` is a blob with the
418// specified size.
419func (g *Graph) RegisterBlob(oid git.OID, objectSize counts.Count32) {
420 size := BlobSize{Size: objectSize}
421 // There are no listeners. Since this is a blob, we know all that
422 // we need to know about it. So skip the record and just fill in
423 // the size.
424 g.blobLock.Lock()
425 g.blobSizes[oid] = size
426 g.blobLock.Unlock()
427
428 g.historyLock.Lock()
429 g.historySize.recordBlob(g, oid, size)
430 g.historyLock.Unlock()
431}
432
433// The `Require*Size` functions behave as follows:
434//

Callers 1

ScanRepositoryUsingGraphFunction · 0.95

Calls 1

recordBlobMethod · 0.80

Tested by

no test coverage detected