Repository navigation
Commit 5df823f
committed
refdb_fs: load packed-refs only when necessary
When checking if a ref exists, we load the packed-refs file and then
return true if the ref is found either loose or in the packed-refs
cache.
This is subject to the same race described in the previous commit, where
a simultaneous pack-refs may migrate a ref from loose to packed and
cause us to see neither. We can fix it by making sure we load
packed-refs only after checking the loose store.
As a bonus, this is a minor optimization: we'll avoid even looking at
the packed-refs file if we see a loose version.1 parent 83d4060 commit 5df823f
1 file changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
337 | | - | |
| 336 | + | |
338 | 337 | | |
| 338 | + | |
| 339 | + | |
339 | 340 | | |
340 | | - | |
341 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
342 | 346 | | |
343 | | - | |
344 | 347 | | |
345 | 348 | | |
346 | 349 | | |
| |||
0 commit comments