diff options
| author | Patrick Steinhardt <ps@pks.im> | 2026-02-23 12:59:45 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-23 13:21:18 -0800 |
| commit | 00be226f1f2a1036ea3920f8700b23b7cc55bf57 (patch) | |
| tree | 34cf7daa6ad015c32e8400fbf99747461cc3c151 /builtin/rev-parse.c | |
| parent | 5507200b504f478516bf93767ac3ed3bebed7226 (diff) | |
| download | git-00be226f1f2a1036ea3920f8700b23b7cc55bf57.tar.xz | |
refs: replace `refs_for_each_ref_in()`
Replace calls to `refs_for_each_ref_in()` with the newly introduced
`refs_for_each_ref_ext()` function.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rev-parse.c')
| -rw-r--r-- | builtin/rev-parse.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 9032cc6327..02703f2fb8 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -613,13 +613,18 @@ static int opt_with_value(const char *arg, const char *opt, const char **value) static void handle_ref_opt(const char *pattern, const char *prefix) { - if (pattern) + if (pattern) { refs_for_each_glob_ref_in(get_main_ref_store(the_repository), show_reference, pattern, prefix, NULL); - else - refs_for_each_ref_in(get_main_ref_store(the_repository), - prefix, show_reference, NULL); + } else { + struct refs_for_each_ref_options opts = { + .prefix = prefix, + .trim_prefix = strlen(prefix), + }; + refs_for_each_ref_ext(get_main_ref_store(the_repository), + show_reference, NULL, &opts); + } clear_ref_exclusions(&ref_excludes); } |
