Skip to content

Commit 1b850d3

Browse files
derrickstoleegitster
authored andcommitted
checkout-index: ensure full index
Before we iterate over all cache entries, ensure that the index is not sparse. This loop in checkout_all() might be safe to iterate over a sparse index, but let's put this protection here until it can be carefully tested. Signed-off-by: Derrick Stolee <[email protected]> Reviewed-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 54beed2 commit 1b850d3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/checkout-index.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ static void checkout_all(const char *prefix, int prefix_length)
119119
int i, errs = 0;
120120
struct cache_entry *last_ce = NULL;
121121

122+
/* TODO: audit for interaction with sparse-index. */
123+
ensure_full_index(&the_index);
122124
for (i = 0; i < active_nr ; i++) {
123125
struct cache_entry *ce = active_cache[i];
124126
if (ce_stage(ce) != checkout_stage

0 commit comments

Comments
 (0)