Re: [PATCH 07/17] refs/files: perform consistency checks for root refs
- From
shejialuo <shejialuo@gmail.com>
- Date
- Jan 10, 2026, 12:47 UTC
- Message-ID
- <aWJKYzcY3H_-xy1V@ArchLinux>
- In-Reply-To
- <20260109-pks-refs-verify-fixes-v1-7-3587dba18294@pks.im>
On Fri, Jan 09, 2026 at 01:39:36PM +0100, Patrick Steinhardt wrote:
Show 20 quoted lines
> static int files_fsck(struct ref_store *ref_store,
> struct fsck_options *o,
> struct worktree *wt)
> {
> struct files_ref_store *refs =
> files_downcast(ref_store, REF_STORE_READ, "fsck");
> + struct files_fsck_root_ref_data data = {
> + .refs = refs,
> + .o = o,
> + .wt = wt,
> + .refname = STRBUF_INIT,
> + .path = STRBUF_INIT,
> + };
> int ret = 0;
>
> if (files_fsck_refs_dir(ref_store, o, wt) < 0)
> ret = -1;
> +
> + if (for_each_root_ref(refs, files_fsck_root_ref, &data) < 0 ||
> + data.errors_found)I am wondering where we update this filed in `files_fsck_root_ref`. It seems that we never do this in this commit. I think we should delete this filed in `files_fsck_root_ref_data` and add this field back when we do need this to avoid confusion.
Thanks, Jialuo