aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/sparse-checkout.c
diff options
context:
space:
mode:
authorDerrick Stolee <stolee@gmail.com>2024-09-23 19:31:22 +0000
committerJunio C Hamano <gitster@pobox.com>2024-09-23 13:19:01 -0700
commit537e516a39a760fddc4f3f5020c4118943f6c146 (patch)
treeb1c81e108e7fdc8c2933c5baf46bbafa3d2b7b62 /builtin/sparse-checkout.c
parentGit 2.46.2 (diff)
downloadgit-537e516a39a760fddc4f3f5020c4118943f6c146.tar.gz
git-537e516a39a760fddc4f3f5020c4118943f6c146.zip
sparse-checkout: disable advice in 'disable'
When running 'git sparse-checkout disable' with the sparse index enabled, Git is expected to expand the index into a full index. However, it currently outputs the advice message saying that that is unexpected and likely due to an issue with the working directory. Disable this advice message when in this code path. Establish a pattern for doing a similar removal in the future. Signed-off-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/sparse-checkout.c')
-rw-r--r--builtin/sparse-checkout.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c
index 2604ab04df..fe4f11390c 100644
--- a/builtin/sparse-checkout.c
+++ b/builtin/sparse-checkout.c
@@ -925,6 +925,11 @@ static int sparse_checkout_disable(int argc, const char **argv,
builtin_sparse_checkout_disable_options,
builtin_sparse_checkout_disable_usage, 0);
+ /*
+ * Disable the advice message for expanding a sparse index, as we
+ * are expecting to do that when disabling sparse-checkout.
+ */
+ give_advice_on_expansion = 0;
repo_read_index(the_repository);
memset(&pl, 0, sizeof(pl));