EncodedObjectSize returns the plaintext size of the given object, without actually reading the full object data from storage.
(h plumbing.Hash)
| 319 | // EncodedObjectSize returns the plaintext size of the given object, |
| 320 | // without actually reading the full object data from storage. |
| 321 | func (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. |