Skip to content

Commit a029120

Browse files
derrickstoleegitster
authored andcommitted
stash: ensure full index
Before iterating over all cache entries, ensure that a sparse index is expanded to a full index to avoid unexpected behavior. Signed-off-by: Derrick Stolee <[email protected]> Reviewed-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e43e2a1 commit a029120

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/stash.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,8 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
13501350
int i;
13511351
char *ps_matched = xcalloc(ps->nr, 1);
13521352

1353+
/* TODO: audit for interaction with sparse-index. */
1354+
ensure_full_index(&the_index);
13531355
for (i = 0; i < active_nr; i++)
13541356
ce_path_match(&the_index, active_cache[i], ps,
13551357
ps_matched);

0 commit comments

Comments
 (0)