Commit 93d3011
committed
pack/set.go: close potentially-opened index files
In [1], we matched upstream Git's behavior more closely by (1) first
opening the corresponding *.idx, and _then_ opening the associated
*.pack, skipping over any pairs which had missing/corrupt index files.
In this commit, augment that behavior by closing a file descriptor we
may have opened, but is otherwise deemed by os.Open to be unusable for
one reason or another.
This path is unlikely in practice, but is a safe change nonetheless.
[1]: 561ed22 (pack/set: ignore packs without indices, 2018-11-29)1 parent f0db732 commit 93d3011
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
0 commit comments