]> git.ipfire.org Git - thirdparty/git.git/commitdiff
refs: move consistency check msg to generic layer
authorKarthik Nayak <karthik.188@gmail.com>
Tue, 7 Oct 2025 12:11:26 +0000 (14:11 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 Oct 2025 16:22:57 +0000 (09:22 -0700)
The files-backend prints a message before the consistency checks run.
Move this to the generic layer so both the files and reftable backend
can benefit from this message.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
refs/files-backend.c

diff --git a/refs.c b/refs.c
index bfdbe718b70a3806cdc2e1da88dc96a90aeee3ce..ad55876c0682859066220e7e669eb2216ff0e1e5 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -32,6 +32,7 @@
 #include "commit.h"
 #include "wildmatch.h"
 #include "ident.h"
+#include "fsck.h"
 
 /*
  * List of all available backends
@@ -323,6 +324,9 @@ int check_refname_format(const char *refname, int flags)
 int refs_fsck(struct ref_store *refs, struct fsck_options *o,
              struct worktree *wt)
 {
+       if (o->verbose)
+               fprintf_ln(stderr, _("Checking references consistency"));
+
        return refs->be->fsck(refs, o, wt);
 }
 
index 1bdca2ece3e04f8444a9e61f3d7d03eddfc32f65..62cbedec2a166b8c7705bc16c2c3e27960195d42 100644 (file)
@@ -3826,8 +3826,6 @@ static int files_fsck_refs(struct ref_store *ref_store,
                NULL,
        };
 
-       if (o->verbose)
-               fprintf_ln(stderr, _("Checking references consistency"));
        return files_fsck_refs_dir(ref_store, o, "refs", wt, fsck_refs_fn);
 }