summaryrefslogtreecommitdiff
path: root/commit-graph.h
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2019-06-18 18:14:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-20 03:46:26 (GMT)
commit3da4b609bb14b13672f64af908706462617f53cb (patch)
tree4930d74aff3855555c647f3b3c28ccde2331606c /commit-graph.h
parentc2bc6e6ab0ade70c475a73d06326e677e70840d2 (diff)
downloadgit-3da4b609bb14b13672f64af908706462617f53cb.zip
git-3da4b609bb14b13672f64af908706462617f53cb.tar.gz
git-3da4b609bb14b13672f64af908706462617f53cb.tar.bz2
commit-graph: verify chains with --shallow mode
If we wrote a commit-graph chain, we only modified the tip file in the chain. It is valuable to verify what we wrote, but not waste time checking files we did not write. Add a '--shallow' option to the 'git commit-graph verify' subcommand and check that it does not read the base graph in a two-file chain. Making the verify subcommand read from a chain of commit-graphs takes some rearranging of the builtin code. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.h')
-rw-r--r--commit-graph.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/commit-graph.h b/commit-graph.h
index a84c22a..df9a3b2 100644
--- a/commit-graph.h
+++ b/commit-graph.h
@@ -61,7 +61,7 @@ struct commit_graph {
};
struct commit_graph *load_commit_graph_one_fd_st(int fd, struct stat *st);
-
+struct commit_graph *read_commit_graph_one(struct repository *r, const char *obj_dir);
struct commit_graph *parse_commit_graph(void *graph_map, int fd,
size_t graph_size);
@@ -95,7 +95,9 @@ int write_commit_graph(const char *obj_dir,
unsigned int flags,
const struct split_commit_graph_opts *split_opts);
-int verify_commit_graph(struct repository *r, struct commit_graph *g);
+#define COMMIT_GRAPH_VERIFY_SHALLOW (1 << 0)
+
+int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags);
void close_commit_graph(struct raw_object_store *);
void free_commit_graph(struct commit_graph *);