Thread (150 messages) 150 messages, 4 authors, 2024-11-20

Re: [PATCH v1 2/4] ref: add regular ref content check for files backend

flat view

From: Patrick Steinhardt <hidden>
Date: 2024-08-22 08:48:35

On Sun, Aug 18, 2024 at 11:01:44PM +0800, shejialuo wrote:
quoted hunk ↗ jump to hunk
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help