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

Function setPath

sizes/sizes.go:219–227  ·  view source on GitHub ↗

Convenience function: forget `*path` if it is non-nil and overwrite it with a `*Path` for the object corresponding to `(oid, objectType)`. This function can be used if a new largest item was found.

(
	pr PathResolver,
	path **Path,
	oid git.OID, objectType string)

Source from the content-addressed store, hash-verified

217// objectType)`. This function can be used if a new largest item was
218// found.
219func setPath(
220 pr PathResolver,
221 path **Path,
222 oid git.OID, objectType string) {
223 if *path != nil {
224 pr.ForgetPath(*path)
225 }
226 *path = pr.RequestPath(oid, objectType)
227}
228
229func (s *HistorySize) recordBlob(g *Graph, oid git.OID, blobSize BlobSize) {
230 s.UniqueBlobCount.Increment(1)

Callers 4

recordBlobMethod · 0.85
recordTreeMethod · 0.85
recordCommitMethod · 0.85
recordTagMethod · 0.85

Calls 2

ForgetPathMethod · 0.65
RequestPathMethod · 0.65

Tested by

no test coverage detected