summaryrefslogtreecommitdiff
path: root/include/git2/sys/commit.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-05-02 18:06:14 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-05-02 18:27:02 +0200
commit0ddfcb40d5ddf2e6d74f061efcccd944d18460cc (patch)
treeec5b73143fd5f0d02c79936b33ae99f244cd4f39 /include/git2/sys/commit.h
parent34bd59992e9e11107d16837b671f867e2a5e77ef (diff)
downloadlibgit2-0ddfcb40d5ddf2e6d74f061efcccd944d18460cc.tar.gz
Switch to index_version as "git_pack_file is ready" flag
We use p->index_map.data to check whether the struct has been set up and all the information about the index is stored there. This variable gets set up halfway through the setup process, however, and a thread can come along and use fields that haven't been written to yet. Crucially, pack_entry_find_offset() needs to read the index version (which is written after index_map) to know the offset and stride length to pass to sha1_entry_pos(). If these values are wrong, assertions in it will fail, as it will be reading bogus data. Make index_version the last field to be written and switch from using p->index_map.data to p->index_version as "git_pack_file is ready" flag as we can use it to know if every field has been written.
Diffstat (limited to 'include/git2/sys/commit.h')
0 files changed, 0 insertions, 0 deletions