diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-03-09 14:36:55 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-09 14:36:55 -0700 |
| commit | d445aecfb013ae7b45e946f9aea06464aee69ed8 (patch) | |
| tree | 14885f56e1e54ecbbf7d8350c1f5e4b753642f0d /upload-pack.c | |
| parent | 5c56c725f104ce278fe1ec0ea0fce0ccfb245aea (diff) | |
| parent | 1dd4f1e43f8f11ebb13c1b9edbd91219a134443d (diff) | |
| download | git-d445aecfb013ae7b45e946f9aea06464aee69ed8.tar.xz | |
Merge branch 'ps/refs-for-each'
Code refactoring around refs-for-each-* API functions.
* ps/refs-for-each:
refs: replace `refs_for_each_fullref_in()`
refs: replace `refs_for_each_namespaced_ref()`
refs: replace `refs_for_each_glob_ref()`
refs: replace `refs_for_each_glob_ref_in()`
refs: replace `refs_for_each_rawref_in()`
refs: replace `refs_for_each_rawref()`
refs: replace `refs_for_each_ref_in()`
refs: improve verification for-each-ref options
refs: generalize `refs_for_each_fullref_in_prefixes()`
refs: generalize `refs_for_each_namespaced_ref()`
refs: speed up `refs_for_each_glob_ref_in()`
refs: introduce `refs_for_each_ref_ext`
refs: rename `each_ref_fn`
refs: rename `do_for_each_ref_flags`
refs: move `do_for_each_ref_flags` further up
refs: move `refs_head_ref_namespaced()`
refs: remove unused `refs_for_each_include_root_ref()`
Diffstat (limited to 'upload-pack.c')
| -rw-r--r-- | upload-pack.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/upload-pack.c b/upload-pack.c index 88dac1b65c..e8c5cce1c7 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -607,10 +607,13 @@ static int allow_hidden_refs(enum allow_uor allow_uor) return !(allow_uor & (ALLOW_TIP_SHA1 | ALLOW_REACHABLE_SHA1)); } -static void for_each_namespaced_ref_1(each_ref_fn fn, +static void for_each_namespaced_ref_1(refs_for_each_cb fn, struct upload_pack_data *data) { - const char **excludes = NULL; + struct refs_for_each_ref_options opts = { + .namespace = get_git_namespace(), + }; + /* * If `data->allow_uor` allows fetching hidden refs, we need to * mark all references (including hidden ones), to check in @@ -621,10 +624,10 @@ static void for_each_namespaced_ref_1(each_ref_fn fn, * hidden references. */ if (allow_hidden_refs(data->allow_uor)) - excludes = hidden_refs_to_excludes(&data->hidden_refs); + opts.exclude_patterns = hidden_refs_to_excludes(&data->hidden_refs); - refs_for_each_namespaced_ref(get_main_ref_store(the_repository), - excludes, fn, data); + refs_for_each_ref_ext(get_main_ref_store(the_repository), + fn, data, &opts); } |
