Thread (1 message) 1 message, 1 author, 2025-07-17

Re: [PATCH v5 0/5] for-each-ref: introduce seeking functionality via '--start-after'

From: Junio C Hamano <hidden>
Date: 2025-07-17 22:21:50

Karthik Nayak [off-list ref] writes:
quoted hunk
This series allows the seek function to set the cursor without setting
the prefix, which is a requirement for pagination. So there is no need
to set 'prefix_state' for this functionality. Which is why I didn't set
it, since the default value of '0' (PREFIX_CONTAINS_DIR) would be the
correct setting for all dirs. This causes the issue.

So the only fix required would be
diff --git a/refs/ref-cache.c b/refs/ref-cache.c
index 1d95b56d40..ceef3a2008 100644
--- a/refs/ref-cache.c
+++ b/refs/ref-cache.c
@@ -527,6 +527,7 @@ static int cache_ref_iterator_seek(struct
ref_iterator *ref_iterator,
 				level = &iter->levels[iter->levels_nr++];
 				level->dir = dir;
 				level->index = -1;
+				level->prefix_state = PREFIX_CONTAINS_DIR;
 			} else {
 				/* reduce the index so the leaf node is iterated over */
 				if (cmp <= 0 && !slash)
Yup, that is inside the code added by this series.  It does look
like it fixes the complaint from the checker.

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