git/t/helper
Patrick Steinhardt bdbebe5714 refs: introduce wrapper struct for `each_ref_fn`
The `each_ref_fn` callback function type is used across our code base
for several different functions that iterate through reference. There's
a bunch of callbacks implementing this type, which makes any changes to
the callback signature extremely noisy. An example of the required churn
is e8207717f1 (refs: add referent to each_ref_fn, 2024-08-09): adding a
single argument required us to change 48 files.

It was already proposed back then [1] that we might want to introduce a
wrapper structure to alleviate the pain going forward. While this of
course requires the same kind of global refactoring as just introducing
a new parameter, it at least allows us to more change the callback type
afterwards by just extending the wrapper structure.

One counterargument to this refactoring is that it makes the structure
more opaque. While it is obvious which callsites need to be fixed up
when we change the function type, it's not obvious anymore once we use
a structure. That being said, we only have a handful of sites that
actually need to populate this wrapper structure: our ref backends,
"refs/iterator.c" as well as very few sites that invoke the iterator
callback functions directly.

Introduce this wrapper structure so that we can adapt the iterator
interfaces more readily.

[1]: <ZmarVcF5JjsZx0dl@tanuki>

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-11-04 07:32:24 -08:00
..
.gitignore
meson.build t/helper: add zlib test-tool 2025-05-16 09:43:11 -07:00
test-advise.c config: move Git config parsing into "environment.c" 2025-07-23 08:15:22 -07:00
test-bitmap.c pack-bitmap: add load corrupt bitmap test 2025-07-01 14:41:54 -07:00
test-bloom.c bloom: rename function operates on bloom_key 2025-07-14 10:03:02 -07:00
test-bundle-uri.c
test-cache-tree.c global: mark code units that generate warnings with `-Wsign-compare` 2024-12-06 20:20:02 +09:00
test-chmtime.c
test-config.c config: drop `git_config_get_bool()` wrapper 2025-07-23 08:15:20 -07:00
test-crontab.c
test-csprng.c wrapper: allow generating insecure random bytes 2025-01-07 09:04:18 -08:00
test-date.c global: mark usage strings and string tables const 2025-04-21 21:01:19 -07:00
test-delete-gpgsig.c
test-delta.c test-delta: close output descriptor after use 2025-07-24 11:28:10 -07:00
test-dir-iterator.c refs/iterator: separate lifecycle from iteration 2025-03-12 11:31:18 -07:00
test-drop-caches.c global: mark code units that generate warnings with `-Wsign-compare` 2024-12-06 20:20:02 +09:00
test-dump-cache-tree.c
test-dump-fsmonitor.c global: trivial conversions to fix `-Wsign-compare` warnings 2024-12-06 20:20:04 +09:00
test-dump-split-index.c global: trivial conversions to fix `-Wsign-compare` warnings 2024-12-06 20:20:04 +09:00
test-dump-untracked-cache.c global: trivial conversions to fix `-Wsign-compare` warnings 2024-12-06 20:20:04 +09:00
test-env-helper.c
test-example-tap.c Merge branch 'jk/mark-unused-parameters' 2024-08-26 11:32:23 -07:00
test-fake-ssh.c
test-find-pack.c packfile: refactor `get_all_packs()` to work on packfile store 2025-09-24 11:53:51 -07:00
test-fsmonitor-client.c
test-genrandom.c t/helper: don't depend on implicit wraparound 2024-12-06 20:20:05 +09:00
test-genzeros.c global: mark code units that generate warnings with `-Wsign-compare` 2024-12-06 20:20:02 +09:00
test-getcwd.c global: mark usage strings and string tables const 2025-04-21 21:01:19 -07:00
test-hash-speed.c global: adapt callers to use generic hash context helpers 2025-01-31 10:06:11 -08:00
test-hash.c global: adapt callers to use generic hash context helpers 2025-01-31 10:06:11 -08:00
test-hashmap.c Merge branch 'jc/string-list-split' 2025-08-21 13:46:59 -07:00
test-hexdump.c
test-json-writer.c string-list: split-then-remove-empty can be done while splitting 2025-08-02 22:34:45 -07:00
test-lazy-init-name-hash.c
test-match-trees.c
test-mergesort.c global: mark code units that generate warnings with `-Wsign-compare` 2024-12-06 20:20:02 +09:00
test-mktemp.c
test-name-hash.c test-tool: add helper for name-hash values 2025-01-27 13:21:43 -08:00
test-online-cpus.c
test-pack-deltas.c odb: drop deprecated wrapper functions 2025-09-11 09:10:28 -07:00
test-pack-mtimes.c packfile: refactor `get_all_packs()` to work on packfile store 2025-09-24 11:53:51 -07:00
test-parse-options.c parse-options: add precision handling for OPTION_COUNTUP 2025-07-09 08:40:32 -07:00
test-parse-pathspec-file.c
test-partial-clone.c odb: rename `oid_object_info()` 2025-07-01 14:46:37 -07:00
test-path-utils.c string-list: align string_list_split() with its _in_place() counterpart 2025-08-02 22:29:27 -07:00
test-path-walk.c path-walk: add new 'edge_aggressive' option 2025-05-16 12:15:40 -07:00
test-pcre2-config.c
test-pkt-line.c
test-proc-receive.c global: mark usage strings and string tables const 2025-04-21 21:01:19 -07:00
test-progress.c progress: stop using `the_repository` 2024-12-18 10:44:30 -08:00
test-reach.c commit-reach: use `size_t` to track indices when computing merge bases 2024-12-27 08:12:40 -08:00
test-read-cache.c config: move Git config parsing into "environment.c" 2025-07-23 08:15:22 -07:00
test-read-graph.c commit-graph: stop passing in redundant repository 2025-08-15 09:34:48 -07:00
test-read-midx.c midx: stop duplicating info redundant with its owning source 2025-08-11 09:22:23 -07:00
test-ref-store.c refs: introduce wrapper struct for `each_ref_fn` 2025-11-04 07:32:24 -08:00
test-reftable.c reftable/table: move printing logic into test helper 2025-04-07 14:53:13 -07:00
test-regex.c
test-repository.c t/test-repository: fix leaking repository 2024-08-01 08:47:37 -07:00
test-revision-walking.c diff.h: fix index used to loop through unsigned integer 2024-12-06 20:20:03 +09:00
test-rot13-filter.c global: mark usage strings and string tables const 2025-04-21 21:01:19 -07:00
test-run-command.c global: mark code units that generate warnings with `-Wsign-compare` 2024-12-06 20:20:02 +09:00
test-scrap-cache-tree.c
test-serve-v2.c serve: stop using `the_repository` 2024-12-18 10:44:30 -08:00
test-sha1.c t/helper/test-tool: implement sha1-unsafe helper 2025-01-23 10:28:16 -08:00
test-sha1.sh t: refactor tests depending on Perl transliteration operator 2025-04-07 14:47:38 -07:00
test-sha256.c t/helper/test-tool: implement sha1-unsafe helper 2025-01-23 10:28:16 -08:00
test-sigchain.c
test-simple-ipc.c builtins: send usage_with_options() help text to standard output 2025-01-17 13:30:03 -08:00
test-string-list.c u-string-list: move "remove duplicates" test to "u-string-list.c" 2025-07-07 08:07:47 -07:00
test-submodule-config.c
test-submodule-nested-repo-config.c hash: stop depending on `the_repository` in `null_oid()` 2025-03-10 13:16:20 -07:00
test-submodule.c global: mark usage strings and string tables const 2025-04-21 21:01:19 -07:00
test-subprocess.c
test-tool-utils.h
test-tool.c t/helper: add zlib test-tool 2025-05-16 09:43:11 -07:00
test-tool.h t/helper: add zlib test-tool 2025-05-16 09:43:11 -07:00
test-trace2.c global: mark code units that generate warnings with `-Wsign-compare` 2024-12-06 20:20:02 +09:00
test-truncate.c t/helper/test-truncate: close file descriptor after truncation 2025-07-22 14:05:34 -07:00
test-userdiff.c config: drop `git_config()` wrapper 2025-07-23 08:15:18 -07:00
test-wildmatch.c
test-windows-named-pipe.c global: mark usage strings and string tables const 2025-04-21 21:01:19 -07:00
test-write-cache.c
test-xml-encode.c
test-zlib.c t/helper: add zlib test-tool 2025-05-16 09:43:11 -07:00