EncodedObjectSize returns the plaintext size of the given object, without actually reading the full object data from storage.
(h plumbing.Hash)
| 310 | // EncodedObjectSize returns the plaintext size of the given object, |
| 311 | // without actually reading the full object data from storage. |
| 312 | func (s *ObjectStorage) EncodedObjectSize(h plumbing.Hash) ( |
| 313 | size int64, err error) { |
| 314 | size, err = s.encodedObjectSizeFromUnpacked(h) |
| 315 | if err != nil && err != plumbing.ErrObjectNotFound { |
| 316 | return 0, err |
| 317 | } else if err == nil { |
| 318 | return size, nil |
| 319 | } |
| 320 | |
| 321 | return s.encodedObjectSizeFromPackfile(h) |
| 322 | } |
| 323 | |
| 324 | // EncodedObject returns the object with the given hash, by searching for it in |
| 325 | // the packfile and the git object directories. |