Thread (105 messages) 105 messages, 5 authors, 2021-04-13

[PATCH 16/27] update-index: ensure full index

flat view
STALE2013d SUPERSEDED

From: Derrick Stolee via GitGitGadget <hidden>
Date: 2021-03-16 21:18:28
Subsystem: the rest · Maintainer: Linus Torvalds

Revision v1 of 3 in this series.

Revisions (3)
  1. v1 current
  2. v2 [diff vs current]
  3. v3 [diff vs current]
From: Derrick Stolee <redacted>

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 <redacted>
---
 builtin/update-index.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 79087bccea4b..8eb654ddc754 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -745,6 +745,7 @@ static int do_reupdate(int ac, const char **av,
 		 */
 		has_head = 0;
  redo:
+	ensure_full_index(&the_index);
 	for (pos = 0; pos < active_nr; pos++) {
 		const struct cache_entry *ce = active_cache[pos];
 		struct cache_entry *old = NULL;
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help