summaryrefslogtreecommitdiffstats
path: root/refs.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-08-16 21:51:51 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-16 21:51:51 +0200
commitb3d175409d9bfe005515ffe361e959fb9965111c (patch)
tree3227deea0e3191061f9b742687957adfb1ff3897 /refs.h
parentThe fifth batch (diff)
parentfsck: add ref name check for files backend (diff)
downloadgit-b3d175409d9bfe005515ffe361e959fb9965111c.tar.xz
git-b3d175409d9bfe005515ffe361e959fb9965111c.zip
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.h')
-rw-r--r--refs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index 6599ffb94b..f8b919a138 100644
--- a/refs.h
+++ b/refs.h
@@ -4,6 +4,7 @@
#include "commit.h"
#include "repository.h"
+struct fsck_options;
struct object_id;
struct ref_store;
struct strbuf;
@@ -542,6 +543,13 @@ int refs_for_each_reflog(struct ref_store *refs, each_reflog_fn fn, void *cb_dat
int check_refname_format(const char *refname, int flags);
/*
+ * Check the reference database for consistency. Return 0 if refs and
+ * reflogs are consistent, and non-zero otherwise. The errors will be
+ * written to stderr.
+ */
+int refs_fsck(struct ref_store *refs, struct fsck_options *o);
+
+/*
* Apply the rules from check_refname_format, but mutate the result until it
* is acceptable, and place the result in "out".
*/