Subject: Re: [PATCH 07/17] refs/files: perform consistency checks for root refs

From: shejialuo <[email-masked]>
Date: Sat, 10 Jan 2026 20:47:31 +0800

On Fri, Jan 09, 2026 at 01:39:36PM +0100, Patrick Steinhardt wrote:
>  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