summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-10-12 13:51:42 -0700
committerJunio C Hamano <gitster@pobox.com>2021-10-12 13:51:42 -0700
commita45b824097aa85e6a940e06d87f2033ced585242 (patch)
treec364341b9f257e4a805cde042bf79d65031452dc
parent0a5af02acb4ae8758ff13459c9362789178714f1 (diff)
parentd9e9b44d7a022ebc57caa3762d1af7e6bf608d5f (diff)
downloadgit-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.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;