diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-10-12 13:51:42 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-12 13:51:42 -0700 |
commit | a45b824097aa85e6a940e06d87f2033ced585242 (patch) | |
tree | c364341b9f257e4a805cde042bf79d65031452dc | |
parent | Merge branch 'ka/want-ref-in-namespace' into maint (diff) | |
parent | sparse-index: copy dir_hash in ensure_full_index() (diff) | |
download | tgif-a45b824097aa85e6a940e06d87f2033ced585242.tar.xz |
Merge branch 'jh/sparse-index-resize-fix' into maint
The sparse-index support can corrupt the index structure by storing
a stale and/or uninitialized data, which has been corrected.
* jh/sparse-index-resize-fix:
sparse-index: copy dir_hash in ensure_full_index()
-rw-r--r-- | sparse-index.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sparse-index.c b/sparse-index.c index c6b4feec41..56eb65dc34 100644 --- a/sparse-index.c +++ b/sparse-index.c @@ -283,6 +283,7 @@ void ensure_full_index(struct index_state *istate) /* Copy back into original index. */ memcpy(&istate->name_hash, &full->name_hash, sizeof(full->name_hash)); + memcpy(&istate->dir_hash, &full->dir_hash, sizeof(full->dir_hash)); istate->sparse_index = 0; free(istate->cache); istate->cache = full->cache; |