Re: [PATCH v1 2/4] ref: add regular ref content check for files backend
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Aug 22, 2024, 08:48 UTC
- Message-ID
- <Zsb7XgX4Lt_4LX_P@tanuki>
- In-Reply-To
- <ZsIM2DRDbJsvNjAM@ArchLinux>
On Sun, Aug 18, 2024 at 11:01:44PM +0800, shejialuo wrote:
Show 19 quoted lines
> +static int files_fsck_refs_content(struct ref_store *ref_store,
> + struct fsck_options *o,
> + const char *refs_check_dir,
> + struct dir_iterator *iter)
> +{
> + struct fsck_ref_report report = FSCK_REF_REPORT_DEFAULT;
> + struct strbuf ref_content = STRBUF_INIT;
> + struct strbuf referent = STRBUF_INIT;
> + struct strbuf refname = STRBUF_INIT;
> + const char *trailing = NULL;
> + unsigned int type = 0;
> + int failure_errno = 0;
> + struct object_id oid;
> + int ret = 0;
> +
> + strbuf_addf(&refname, "%s/%s", refs_check_dir, iter->relative_path);
> + report.path = refname.buf;
> +
> + if (S_ISREG(iter->st.st_mode)) {We can avoid having to indent the remainder of this function if we `goto cleanup` here.
Patrick