summaryrefslogtreecommitdiff
path: root/src/annotated_commit.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-02-15 04:43:30 -0500
committerJeff King <peff@peff.net>2019-02-15 04:43:30 -0500
commit5df823f02fc6f6a5e50aa303b13021cf021a7b61 (patch)
tree2acebad539ac425ca18cba47f97e508a4927a2ab /src/annotated_commit.c
parent83d40605047577988b95bae2f048abe2eea6192a (diff)
downloadlibgit2-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/annotated_commit.c')
0 files changed, 0 insertions, 0 deletions