aboutsummaryrefslogtreecommitdiffstats
path: root/sparse-index.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 /sparse-index.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 'sparse-index.c')
-rw-r--r--sparse-index.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sparse-index.c b/sparse-index.c
index 9958656ded..0f9fb4df02 100644
--- a/sparse-index.c
+++ b/sparse-index.c
@@ -19,9 +19,10 @@
* advice for advice.sparseIndexExpanded when expanding a sparse index to a full
* one. However, this is sometimes done on purpose, such as in the sparse-checkout
* builtin, even when index.sparse=false. This may be disabled in
- * convert_to_sparse().
+ * convert_to_sparse() or by commands that know they will lead to a full
+ * expansion, but this message is not actionable.
*/
-static int give_advice_on_expansion = 1;
+int give_advice_on_expansion = 1;
#define ADVICE_MSG \
"The sparse index is expanding to a full index, a slow operation.\n" \
"Your working directory likely has contents that are outside of\n" \