From: Karthik Nayak Date: Tue, 7 Oct 2025 12:11:26 +0000 (+0200) Subject: refs: move consistency check msg to generic layer X-Git-Tag: v2.52.0-rc0~64^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1ef32f09897754c607f1e16df396c5ac545a1297;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/refs.c b/refs.c index bfdbe718b7..ad55876c06 100644 --- 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); } diff --git a/refs/files-backend.c b/refs/files-backend.c index 1bdca2ece3..62cbedec2a 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -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); }