Skip to content

Commit f9ae4a7

Browse files
authored
Merge pull request #9 from git-lfs/ttaylorr-close-failed-indices
pack/set.go: close potentially-opened index files
2 parents f0db732 + 93d3011 commit f9ae4a7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pack/set.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ func NewSet(db string) (*Set, error) {
6060
// We have a pack (since it matched the regex), but the
6161
// index is missing or unusable. Skip this pack and
6262
// continue on with the next one, as Git does.
63+
if idxf != nil {
64+
// In the unlikely event that we did open a
65+
// file, close it, but discard any error in
66+
// doing so.
67+
idxf.Close()
68+
}
6369
continue
6470
}
6571

0 commit comments

Comments
 (0)