diff options
author | Jeff King <peff@peff.net> | 2019-02-15 04:43:30 -0500 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2019-02-15 04:43:30 -0500 |
commit | 5df823f02fc6f6a5e50aa303b13021cf021a7b61 (patch) | |
tree | 2acebad539ac425ca18cba47f97e508a4927a2ab /src/notes.c | |
parent | 83d40605047577988b95bae2f048abe2eea6192a (diff) | |
download | libgit2-packed-refs-race.tar.gz |
refdb_fs: load packed-refs only when necessarypacked-refs-race
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.
Diffstat (limited to 'src/notes.c')
0 files changed, 0 insertions, 0 deletions