Skip to content

Commit

Permalink
packfile: add comment on GetSizeByOffset
Browse files Browse the repository at this point in the history
Suggested by mcuadros.

Issue: src-d#982
Signed-off-by: Jeremy Stribling <[email protected]>
  • Loading branch information
strib committed Oct 15, 2018
1 parent b3a3f0a commit 6faf286
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plumbing/format/packfile/packfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6faf286

Please sign in to comment.