diff options
author | Jeremy Stribling <strib@alum.mit.edu> | 2018-10-15 10:17:37 -0700 |
---|---|---|
committer | Jeremy Stribling <strib@alum.mit.edu> | 2018-10-15 10:20:38 -0700 |
commit | 6faf286b97ff2e13fbdaf2c6179f8aef36b4498c (patch) | |
tree | 5e41ec7dd7fc2efd692b418f945c8cfe462fa045 | |
parent | b3a3f0ab953608fb283392d4431a963622643b4c (diff) | |
download | go-git-6faf286b97ff2e13fbdaf2c6179f8aef36b4498c.tar.gz |
packfile: add comment on GetSizeByOffset
Suggested by mcuadros.
Issue: src-d/go-git#982
Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
-rw-r--r-- | plumbing/format/packfile/packfile.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/plumbing/format/packfile/packfile.go b/plumbing/format/packfile/packfile.go index dbd5d4b..0d13066 100644 --- a/plumbing/format/packfile/packfile.go +++ b/plumbing/format/packfile/packfile.go @@ -90,6 +90,8 @@ func (p *Packfile) GetByOffset(o int64) (plumbing.EncodedObject, error) { return p.nextObject() } +// GetSizeByOffset retrieves the size of the encoded object from the +// packfile with the given offset. func (p *Packfile) GetSizeByOffset(o int64) (size int64, err error) { if _, err := p.s.SeekFromStart(o); err != nil { if err == io.EOF || isInvalid(err) { |