diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-08-18 13:07:05 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-08-18 13:07:05 -0700 |
| commit | 9b9445cfdec254dfd5e78fb00ec4476cee3d578c (patch) | |
| tree | 81f69acdd36776f119f0e91e50f31c789fd9534a /pathspec.h | |
| parent | 80ffc849bdd5ed111a2ec070856ef67e075572c6 (diff) | |
| parent | ede241c7154929c5c80fb784daa79de6103bf048 (diff) | |
| download | git-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.h | 12 |
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 */ |
