summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-09-10 11:46:23 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-09-10 11:46:23 -0700
commit6f9e7cadf35796d798037782f149bec584ff803c (patch)
tree8efd2eb97ef7e419ea1882105c7424b98d6bb174
parentMerge branch 'es/walken-tutorial-fix' (diff)
parentsparse-index: copy dir_hash in ensure_full_index() (diff)
downloadtgif-6f9e7cadf35796d798037782f149bec584ff803c.tar.xz
Merge branch 'jh/sparse-index-resize-fix'
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.c1
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;