refs: move consistency check msg to generic layer

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>

Karthik Nayak committed Oct 7, 2025 at 14:11 UTC 1ef32f09897754c607f1e16df396c5ac545a1297
2 files changed +4 -2
refs.c
+4
@@ -32,6 +32,7 @@
32 #include "commit.h"
33 #include "wildmatch.h"
34 #include "ident.h"
35 +#include "fsck.h"
36
37 /*
38 * List of all available backends
@@ -323,6 +324,9 @@ int check_refname_format(const char *refname, int flags)
324 int refs_fsck(struct ref_store *refs, struct fsck_options *o,
325 struct worktree *wt)
326 {
327 + if (o->verbose)
328 + fprintf_ln(stderr, _("Checking references consistency"));
329 +
330 return refs->be->fsck(refs, o, wt);
331 }
332
refs/files-backend.c
-2
@@ -3826,8 +3826,6 @@ static int files_fsck_refs(struct ref_store *ref_store,
3826 NULL,
3827 };
3828
3829 - if (o->verbose)
3830 - fprintf_ln(stderr, _("Checking references consistency"));
3829 return files_fsck_refs_dir(ref_store, o, "refs", wt, fsck_refs_fn);
3830 }
3831