From: Derrick Stolee Date: Mon, 23 May 2022 13:48:42 +0000 (+0000) Subject: sparse-checkout: --no-sparse-index needs a full index X-Git-Tag: v2.37.0-rc0~33^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d443389fddf1b9b50664669b55c701a53f12eb2;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c index 5b054400bf..1db51c3fd7 100644 --- a/builtin/sparse-checkout.c +++ b/builtin/sparse-checkout.c @@ -413,6 +413,9 @@ static int update_modes(int *cone_mode, int *sparse_index) /* force an index rewrite */ repo_read_index(the_repository); the_repository->index->updated_workdir = 1; + + if (!*sparse_index) + ensure_full_index(the_repository->index); } return 0;