summaryrefslogtreecommitdiff
path: root/sparse-index.c
diff options
context:
space:
mode:
Diffstat (limited to 'sparse-index.c')
-rw-r--r--sparse-index.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sparse-index.c b/sparse-index.c
index 9958656ded..5634abafaa 100644
--- a/sparse-index.c
+++ b/sparse-index.c
@@ -1,5 +1,9 @@
+#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
+
#include "git-compat-util.h"
#include "environment.h"
+#include "ewah/ewok.h"
#include "gettext.h"
#include "name-hash.h"
#include "read-cache-ll.h"
@@ -19,9 +23,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" \
@@ -239,7 +244,8 @@ int convert_to_sparse(struct index_state *istate, int flags)
cache_tree_update(istate, 0);
istate->fsmonitor_has_run_once = 0;
- FREE_AND_NULL(istate->fsmonitor_dirty);
+ ewah_free(istate->fsmonitor_dirty);
+ istate->fsmonitor_dirty = NULL;
FREE_AND_NULL(istate->fsmonitor_last_update);
istate->sparse_index = INDEX_COLLAPSED;
@@ -435,7 +441,8 @@ void expand_index(struct index_state *istate, struct pattern_list *pl)
istate->cache_nr = full->cache_nr;
istate->cache_alloc = full->cache_alloc;
istate->fsmonitor_has_run_once = 0;
- FREE_AND_NULL(istate->fsmonitor_dirty);
+ ewah_free(istate->fsmonitor_dirty);
+ istate->fsmonitor_dirty = NULL;
FREE_AND_NULL(istate->fsmonitor_last_update);
strbuf_release(&base);