Skip to content

Commit f5fed74

Browse files
derrickstoleegitster
authored andcommitted
revision: ensure full index
Before iterating over all index entries, ensure that a sparse index is expanded to a full index to avoid unexpected behavior. This case could be integrated later by ensuring that we walk the tree in the sparse-directory entry, but the current behavior is only expecting blobs. Save this integration for later when it can be properly tested. Signed-off-by: Derrick Stolee <[email protected]> Reviewed-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dc26b23 commit f5fed74

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

revision.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,6 +1680,8 @@ static void do_add_index_objects_to_pending(struct rev_info *revs,
16801680
{
16811681
int i;
16821682

1683+
/* TODO: audit for interaction with sparse-index. */
1684+
ensure_full_index(istate);
16831685
for (i = 0; i < istate->cache_nr; i++) {
16841686
struct cache_entry *ce = istate->cache[i];
16851687
struct blob *blob;

0 commit comments

Comments
 (0)