Re: [PATCH v5 0/5] for-each-ref: introduce seeking functionality via '--start-after'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 17, 2025, 22:21 UTC
- Message-ID
- <xmqqwm864fwk.fsf@gitster.g>
- In-Reply-To
- <CAOLa=ZQPOP0DkK9L5XLmA_uzH7jWwX-ti8AgaEcAF2Mon=w0BA@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 21 quoted lines
> 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.