aboutsummaryrefslogtreecommitdiffstats
path: root/pathspec.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-08-18 13:07:05 -0700
committerJunio C Hamano <gitster@pobox.com>2022-08-18 13:07:05 -0700
commit9b9445cfdec254dfd5e78fb00ec4476cee3d578c (patch)
tree81f69acdd36776f119f0e91e50f31c789fd9534a /pathspec.h
parent80ffc849bdd5ed111a2ec070856ef67e075572c6 (diff)
parentede241c7154929c5c80fb784daa79de6103bf048 (diff)
downloadgit-9b9445cfdec254dfd5e78fb00ec4476cee3d578c.tar.gz
Merge branch 'sy/sparse-rm'
"git rm" has become more aware of the sparse-index feature. * sy/sparse-rm: rm: integrate with sparse-index rm: expand the index only when necessary pathspec.h: move pathspec_needs_expanded_index() from reset.c to here t1092: add tests for `git-rm`
Diffstat (limited to 'pathspec.h')
-rw-r--r--pathspec.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/pathspec.h b/pathspec.h
index 402ebb8080..41f6adfbb4 100644
--- a/pathspec.h
+++ b/pathspec.h
@@ -171,4 +171,16 @@ int match_pathspec_attrs(struct index_state *istate,
const char *name, int namelen,
const struct pathspec_item *item);
+/*
+ * Determine whether a pathspec will match only entire index entries (non-sparse
+ * files and/or entire sparse directories). If the pathspec has the potential to
+ * match partial contents of a sparse directory, return 1 to indicate the index
+ * should be expanded to match the appropriate index entries.
+ *
+ * For the sake of simplicity, always return 1 if using a more complex "magic"
+ * pathspec.
+ */
+int pathspec_needs_expanded_index(struct index_state *istate,
+ const struct pathspec *pathspec);
+
#endif /* PATHSPEC_H */