diff --git a/pack/set.go b/pack/set.go index 8c50c17..d6a6bd2 100644 --- a/pack/set.go +++ b/pack/set.go @@ -60,6 +60,12 @@ func NewSet(db string) (*Set, error) { // We have a pack (since it matched the regex), but the // index is missing or unusable. Skip this pack and // continue on with the next one, as Git does. + if idxf != nil { + // In the unlikely event that we did open a + // file, close it, but discard any error in + // doing so. + idxf.Close() + } continue }