Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Commit

Permalink
Remove unused method (#1022)
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Jesus Navarro Perez <antnavper@gmail.com>
  • Loading branch information
ajnavarro authored and mcuadros committed Nov 16, 2018
1 parent a779a26 commit 1e77971
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions plumbing/format/packfile/packfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,62 +114,6 @@ func (p *Packfile) nextObjectHeader() (*ObjectHeader, error) {
return h, err
}

func (p *Packfile) getObjectData(
h *ObjectHeader,
) (typ plumbing.ObjectType, size int64, err error) {
switch h.Type {
case plumbing.CommitObject, plumbing.TreeObject, plumbing.BlobObject, plumbing.TagObject:
typ = h.Type
size = h.Length
case plumbing.REFDeltaObject, plumbing.OFSDeltaObject:
buf := bufPool.Get().(*bytes.Buffer)
buf.Reset()
defer bufPool.Put(buf)

_, _, err = p.s.NextObject(buf)
if err != nil {
return
}

delta := buf.Bytes()
_, delta = decodeLEB128(delta) // skip src size
sz, _ := decodeLEB128(delta)
size = int64(sz)

var offset int64
if h.Type == plumbing.REFDeltaObject {
offset, err = p.FindOffset(h.Reference)
if err != nil {
return
}
} else {
offset = h.OffsetReference
}

if baseType, ok := p.offsetToType[offset]; ok {
typ = baseType
} else {
if _, err = p.s.SeekFromStart(offset); err != nil {
return
}

h, err = p.nextObjectHeader()
if err != nil {
return
}

typ, _, err = p.getObjectData(h)
if err != nil {
return
}
}
default:
err = ErrInvalidObject.AddDetails("type %q", h.Type)
}

return
}

func (p *Packfile) getObjectSize(h *ObjectHeader) (int64, error) {
switch h.Type {
case plumbing.CommitObject, plumbing.TreeObject, plumbing.BlobObject, plumbing.TagObject:
Expand Down

0 comments on commit 1e77971

Please sign in to comment.