aboutsummaryrefslogtreecommitdiffstats
path: root/refs/debug.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-08-16 12:51:51 -0700
committerJunio C Hamano <gitster@pobox.com>2024-08-16 12:51:51 -0700
commitb3d175409d9bfe005515ffe361e959fb9965111c (patch)
tree3227deea0e3191061f9b742687957adfb1ff3897 /refs/debug.c
parent87a1768b93a67d0420255a43d9e07387b2e805ad (diff)
parent1c31be45b3b263670c7d2a91c27cc119b77dd2e2 (diff)
downloadgit-b3d175409d9bfe005515ffe361e959fb9965111c.tar.gz
Merge branch 'sj/ref-fsck'
"git fsck" infrastructure has been taught to also check the sanity of the ref database, in addition to the object database. * sj/ref-fsck: fsck: add ref name check for files backend files-backend: add unified interface for refs scanning builtin/refs: add verify subcommand refs: set up ref consistency check infrastructure fsck: add refs report function fsck: add a unified interface for reporting fsck messages fsck: make "fsck_error" callback generic fsck: rename objects-related fsck error functions fsck: rename "skiplist" to "skip_oids"
Diffstat (limited to 'refs/debug.c')
-rw-r--r--refs/debug.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/refs/debug.c b/refs/debug.c
index 547d9245b9..45e2e784a0 100644
--- a/refs/debug.c
+++ b/refs/debug.c
@@ -419,6 +419,15 @@ static int debug_reflog_expire(struct ref_store *ref_store, const char *refname,
return res;
}
+static int debug_fsck(struct ref_store *ref_store,
+ struct fsck_options *o)
+{
+ struct debug_ref_store *drefs = (struct debug_ref_store *)ref_store;
+ int res = drefs->refs->be->fsck(drefs->refs, o);
+ trace_printf_key(&trace_refs, "fsck: %d\n", res);
+ return res;
+}
+
struct ref_storage_be refs_be_debug = {
.name = "debug",
.init = NULL,
@@ -451,4 +460,6 @@ struct ref_storage_be refs_be_debug = {
.create_reflog = debug_create_reflog,
.delete_reflog = debug_delete_reflog,
.reflog_expire = debug_reflog_expire,
+
+ .fsck = debug_fsck,
};