aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Stribling <strib@alum.mit.edu>2018-10-15 10:17:37 -0700
committerJeremy Stribling <strib@alum.mit.edu>2018-10-15 10:20:38 -0700
commit6faf286b97ff2e13fbdaf2c6179f8aef36b4498c (patch)
tree5e41ec7dd7fc2efd692b418f945c8cfe462fa045
parentb3a3f0ab953608fb283392d4431a963622643b4c (diff)
downloadgo-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.go2
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) {