Skip to content

Commit a45b824

Browse files
committed
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()
2 parents 0a5af02 + d9e9b44 commit a45b824

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sparse-index.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ void ensure_full_index(struct index_state *istate)
283283

284284
/* Copy back into original index. */
285285
memcpy(&istate->name_hash, &full->name_hash, sizeof(full->name_hash));
286+
memcpy(&istate->dir_hash, &full->dir_hash, sizeof(full->dir_hash));
286287
istate->sparse_index = 0;
287288
free(istate->cache);
288289
istate->cache = full->cache;

0 commit comments

Comments
 (0)