]> git.ipfire.org Git - thirdparty/git.git/commitdiff
sparse-checkout: --no-sparse-index needs a full index
authorDerrick Stolee <dstolee@microsoft.com>
Mon, 23 May 2022 13:48:42 +0000 (13:48 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 23 May 2022 18:08:21 +0000 (11:08 -0700)
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 <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/sparse-checkout.c

index 5b054400bf321532cb17296f372a9be1e289a25a..1db51c3fd72da7bd90df9443847bdb38912ffa88 100644 (file)
@@ -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;