path: root/commit-graph.h
diff options
authorDerrick Stolee <>2018-06-27 13:24:32 (GMT)
committerJunio C Hamano <>2018-06-27 17:27:05 (GMT)
commit283e68c72f49e6cfbae53cb5547d5b399ed25d1a (patch)
treea6fd95c90d49b9cb99b5d11c1f8e224d2a9a667c /commit-graph.h
parent0cbef8f8ce6ff434011ecbf3d8d2d41ba6f10c70 (diff)
commit-graph: add 'verify' subcommand
If the commit-graph file becomes corrupt, we need a way to verify that its contents match the object database. In the manner of 'git fsck' we will implement a 'git commit-graph verify' subcommand to report all issues with the file. Add the 'verify' subcommand to the 'commit-graph' builtin and its documentation. The subcommand is currently a no-op except for loading the commit-graph into memory, which may trigger run-time errors that would be caught by normal use. Add a simple test that ensures the command returns a zero error code. If no commit-graph file exists, this is an acceptable state. Do not report any errors. Helped-by: Ramsay Jones <> Signed-off-by: Derrick Stolee <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'commit-graph.h')
1 files changed, 3 insertions, 0 deletions
diff --git a/commit-graph.h b/commit-graph.h
index 96cccb1..4359812 100644
--- a/commit-graph.h
+++ b/commit-graph.h
@@ -2,6 +2,7 @@
#include "git-compat-util.h"
+#include "repository.h"
char *get_commit_graph_filename(const char *obj_dir);
@@ -53,4 +54,6 @@ void write_commit_graph(const char *obj_dir,
int nr_commits,
int append);
+int verify_commit_graph(struct repository *r, struct commit_graph *g);