From b872b71112ed4034bbd9c33a0babd6353b582429 Mon Sep 17 00:00:00 2001 From: Antonio Jesus Navarro Perez Date: Tue, 7 Feb 2017 16:02:46 +0100 Subject: Fix missing objects if they where deltified using ref-delta - Deleted invalid logic that returned nil if an ref-delta was not found into the decoder index. This logic was missing objects if it was deltified using ref-deltas. - Now, to avoid that problem, index is mandatory to decode correctly a packfile of a specific type. Decoder.SetOffsets method now is called into the EncodedObjectIterator to avoid this problem. --- plumbing/format/packfile/decoder.go | 7 ------- 1 file changed, 7 deletions(-) (limited to 'plumbing/format/packfile/decoder.go') diff --git a/plumbing/format/packfile/decoder.go b/plumbing/format/packfile/decoder.go index 9f2174b..475d24d 100644 --- a/plumbing/format/packfile/decoder.go +++ b/plumbing/format/packfile/decoder.go @@ -225,13 +225,6 @@ func (d *Decoder) decodeIfSpecificType(h *ObjectHeader) (plumbing.EncodedObject, realType, err = d.ofsDeltaType(h.OffsetReference) case plumbing.REFDeltaObject: realType, err = d.refDeltaType(h.Reference) - - // If a reference delta is not found, it means that it isn't of - // the type we are looking for, because we don't have any reference - // and it is not present into the object storer - if err == plumbing.ErrObjectNotFound { - return nil, nil - } default: realType = h.Type } -- cgit