Skip to content

Commit 57dc87a

Browse files
committed
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]>
1 parent ecfafff commit 57dc87a

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
@@ -444,6 +444,9 @@ static int sparse_checkout_init(int argc, const char **argv)
444444
/* force an index rewrite */
445445
repo_read_index(the_repository);
446446
the_repository->index->updated_workdir = 1;
447+
448+
if (!init_opts.sparse_index)
449+
ensure_full_index(the_repository->index);
447450
}
448451

449452
core_apply_sparse_checkout = 1;

0 commit comments

Comments
 (0)