From: Junio C Hamano Date: Fri, 27 Feb 2026 23:16:31 +0000 (-0800) Subject: Merge branch 'ps/refs-for-each' into next X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=ec9e0a36ff3761c7fbcc07f8896d299f320b5e71;p=thirdparty%2Fgit.git Merge branch 'ps/refs-for-each' into next 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()` --- ec9e0a36ff3761c7fbcc07f8896d299f320b5e71 diff --cc refs.h index f3a1d604ad,9b5d57a9b7..d98c1fc591 --- a/refs.h +++ b/refs.h @@@ -1426,19 -1431,6 +1431,19 @@@ void ref_iterator_free(struct ref_itera * iterator style. */ int do_for_each_ref_iterator(struct ref_iterator *iter, - each_ref_fn fn, void *cb_data); + refs_for_each_cb fn, void *cb_data); +/* + * Git only recognizes a directory as a repository if it contains: + * - HEAD file + * - refs/ folder + * While it is necessary within the files backend, newer backends may not + * follow the same structure. To go around this, we create stubs as necessary. + * + * If provided with a 'refs_heads_content', we create the 'refs/heads/head' file + * with the provided message. + */ +void refs_create_refdir_stubs(struct repository *repo, const char *refdir, + const char *refs_heads_content); + #endif /* REFS_H */