Skip to content

Commit 2d44338

Browse files
derrickstoleegitster
authored andcommitted
sparse-checkout: --no-sparse-index needs a full index
When the --no-sparse-index option is supplied, the sparse-checkout builtin should explicitly ask to expand a sparse index to a full one. This is currently done implicitly due to the command_requires_full_index protection, but that will be removed in an upcoming change. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 080ab56 commit 2d44338

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

builtin/sparse-checkout.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,9 @@ static int update_modes(int *cone_mode, int *sparse_index)
413413
/* force an index rewrite */
414414
repo_read_index(the_repository);
415415
the_repository->index->updated_workdir = 1;
416+
417+
if (!*sparse_index)
418+
ensure_full_index(the_repository->index);
416419
}
417420

418421
return 0;

0 commit comments

Comments
 (0)