MCPcopy Index your code
hub / github.com/go-git/go-git / EncodedObjectSize

Method EncodedObjectSize

storage/filesystem/object.go:321–332  ·  view source on GitHub ↗

EncodedObjectSize returns the plaintext size of the given object, without actually reading the full object data from storage.

(h plumbing.Hash)

Source from the content-addressed store, hash-verified

319// EncodedObjectSize returns the plaintext size of the given object,
320// without actually reading the full object data from storage.
321func (s *ObjectStorage) EncodedObjectSize(h plumbing.Hash) (
322 size int64, err error,
323) {
324 size, err = s.encodedObjectSizeFromUnpacked(h)
325 if err != nil && err != plumbing.ErrObjectNotFound {
326 return 0, err
327 } else if err == nil {
328 return size, nil
329 }
330
331 return s.encodedObjectSizeFromPackfile(h)
332}
333
334// EncodedObject returns the object with the given hash, by searching for it in
335// the packfile and the git object directories.

Callers 3

Tested by 3