Skip to content

Commit 54beed2

Browse files
derrickstoleegitster
authored andcommitted
add: 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 118a2e8 commit 54beed2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/add.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ static int renormalize_tracked_files(const struct pathspec *pathspec, int flags)
141141
{
142142
int i, retval = 0;
143143

144+
/* TODO: audit for interaction with sparse-index. */
145+
ensure_full_index(&the_index);
144146
for (i = 0; i < active_nr; i++) {
145147
struct cache_entry *ce = active_cache[i];
146148

0 commit comments

Comments
 (0)