]> git.ipfire.org Git - thirdparty/git.git/commitdiff
refs/files: remove useless indirection
authorPatrick Steinhardt <ps@pks.im>
Mon, 12 Jan 2026 09:02:53 +0000 (10:02 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Jan 2026 14:55:40 +0000 (06:55 -0800)
The function `files_fsck_refs()` only has a single callsite and forwards
all of its arguments as-is, so it's basically a useless indirection.
Inline the function call.

While at it, also remove the bitwise or that we have for return values.
We don't really want to or them at all, but rather just want to return
an error in case either of the functions has failed.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c

index 0a104c7bf6a8a5f1d9656828eaed0e14a65fcf8a..4cbee23dad1d5b44b31f3b5ebffb439f1c1b2cd4 100644 (file)
@@ -3954,22 +3954,20 @@ out:
        return ret;
 }
 
-static int files_fsck_refs(struct ref_store *ref_store,
-                          struct fsck_options *o,
-                          struct worktree *wt)
-{
-       return files_fsck_refs_dir(ref_store, o, wt);
-}
-
 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");
+       int ret = 0;
 
-       return files_fsck_refs(ref_store, o, wt) |
-              refs->packed_ref_store->be->fsck(refs->packed_ref_store, o, wt);
+       if (files_fsck_refs_dir(ref_store, o, wt) < 0)
+               ret = -1;
+       if (refs->packed_ref_store->be->fsck(refs->packed_ref_store, o, wt) < 0)
+               ret = -1;
+
+       return ret;
 }
 
 struct ref_storage_be refs_be_files = {