diff options
author | Taylor Blau <me@ttaylorr.com> | 2023-07-10 23:12:22 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-07-10 23:48:55 +0200 |
commit | b269ac53c07aa46d5a88d05dac8216d189e69a50 (patch) | |
tree | b1cfa35537b5721776c98277024291fa7352aae7 /refs.h | |
parent | builtin/for-each-ref.c: add `--exclude` option (diff) | |
download | git-b269ac53c07aa46d5a88d05dac8216d189e69a50.tar.xz git-b269ac53c07aa46d5a88d05dac8216d189e69a50.zip |
refs: plumb `exclude_patterns` argument throughout
The subsequent patch will want to access an optional `excluded_patterns`
array within `refs/packed-backend.c` that will cull out certain
references matching any of the given patterns on a best-effort basis.
To do so, the refs subsystem needs to be updated to pass this value
across a number of different locations.
Prepare for a future patch by introducing this plumbing now, passing
NULLs at top-level APIs in order to make that patch less noisy and more
easily readable.
Signed-off-by: Taylor Blau <me@ttaylorr.co>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r-- | refs.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -338,6 +338,7 @@ int for_each_ref(each_ref_fn fn, void *cb_data); int for_each_ref_in(const char *prefix, each_ref_fn fn, void *cb_data); int refs_for_each_fullref_in(struct ref_store *refs, const char *prefix, + const char **exclude_patterns, each_ref_fn fn, void *cb_data); int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data); @@ -345,10 +346,15 @@ int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data); * iterate all refs in "patterns" by partitioning patterns into disjoint sets * and iterating the longest-common prefix of each set. * + * references matching any pattern in "exclude_patterns" are omitted from the + * result set on a best-effort basis. + * * callers should be prepared to ignore references that they did not ask for. */ int refs_for_each_fullref_in_prefixes(struct ref_store *refs, - const char *namespace, const char **patterns, + const char *namespace, + const char **patterns, + const char **exclude_patterns, each_ref_fn fn, void *cb_data); /** |