Thread (53 messages) 53 messages, 3 authors, 2026-02-24

Re: [PATCH 01/17] refs: move `refs_head_ref_namespaced()`

From: Karthik Nayak <hidden>
Date: 2026-02-23 08:05:29

Patrick Steinhardt [off-list ref] writes:
The function `refs_head_ref_namespaced()` is somewhat special when
compared to most of the other functions that take a callback function:
while `refs_for_each_*()` functions yield multiple refs, we only yield
Perhaps swap s/we/refs_head_ref_namespaced() will/
at most the HEAD ref of the current function. As such, the function is
Should this be s/function/namespace?
quoted hunk ↗ jump to hunk
related to `refs_head_ref()` and not to the for-each functions.

Move the function to be located next to `refs_head_ref()` to clarify.

Signed-off-by: Patrick Steinhardt <redacted>
---
 refs.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/refs.h b/refs.h
index f16b1b697b..62e8ef61e7 100644
--- a/refs.h
+++ b/refs.h
@@ -413,6 +413,9 @@ typedef int each_ref_fn(const struct reference *ref, void *cb_data);
  */
 int refs_head_ref(struct ref_store *refs,
 		  each_ref_fn fn, void *cb_data);
+int refs_head_ref_namespaced(struct ref_store *refs,
+			     each_ref_fn fn, void *cb_data);
+
 int refs_for_each_ref(struct ref_store *refs,
 		      each_ref_fn fn, void *cb_data);
 int refs_for_each_ref_in(struct ref_store *refs, const char *prefix,
@@ -456,8 +459,6 @@ int refs_for_each_glob_ref(struct ref_store *refs, each_ref_fn fn,
 int refs_for_each_glob_ref_in(struct ref_store *refs, each_ref_fn fn,
 			      const char *pattern, const char *prefix, void *cb_data);

-int refs_head_ref_namespaced(struct ref_store *refs, each_ref_fn fn, void *cb_data);
-
 /*
  * references matching any pattern in "exclude_patterns" are omitted from the
  * result set on a best-effort basis.

--
2.53.0.414.gf7e9f6c205.dirty

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help