[PATCH 15/27] sparse-checkout: ensure full index

From
Derrick Stolee via GitGitGadget <hidden>
Date
2021-03-16 21:18:28
Reply to
Derrick Stolee via GitGitGadget, 2021-03-16
From: Derrick Stolee <redacted>

When adjusting the sparse-checkout definition, ensure that a sparse
index is expanded to a full one to avoid unexpected behavior. This is a
top candidate for later integration with the sparse-index, but requires
careful testing.

Signed-off-by: Derrick Stolee <redacted>
---
 builtin/stash.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/builtin/stash.c b/builtin/stash.c
index ba774cce674f..b3d4fe814b6b 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1350,6 +1350,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
 		int i;
 		char *ps_matched = xcalloc(ps->nr, 1);
 
+		ensure_full_index(&the_index);
 		for (i = 0; i < active_nr; i++)
 			ce_path_match(&the_index, active_cache[i], ps,
 				      ps_matched);
-- 
gitgitgadget
Thread (105 messages) 105 messages, 5 authors, 2021-04-13
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help