path: root/commit-graph.h
diff options
authorTaylor Blau <>2020-02-03 21:18:04 (GMT)
committerJunio C Hamano <>2020-02-04 19:36:51 (GMT)
commita7df60cac834cb7f91c3463205c2b6ba5e694200 (patch)
treef01d5060ce47a0e049a520a72c105a367f13cbde /commit-graph.h
parentad2dd5bb63b6c2da0091d63463e29ae27e47a893 (diff)
commit-graph.h: use odb in 'load_commit_graph_one_fd_st'
Apply a similar treatment as in the previous patch to pass a 'struct object_directory *' through the 'load_commit_graph_one_fd_st' initializer, too. This prevents a potential bug where a pointer comparison is made to a NULL 'g->odb', which would cause the commit-graph machinery to think that a pair of commit-graphs belonged to different alternates when in fact they do not (i.e., in the case of no '--object-dir'). Signed-off-by: Taylor Blau <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'commit-graph.h')
1 files changed, 2 insertions, 1 deletions
diff --git a/commit-graph.h b/commit-graph.h
index 5a69072..e87a6f6 100644
--- a/commit-graph.h
+++ b/commit-graph.h
@@ -61,7 +61,8 @@ struct commit_graph {
const unsigned char *chunk_base_graphs;
-struct commit_graph *load_commit_graph_one_fd_st(int fd, struct stat *st);
+struct commit_graph *load_commit_graph_one_fd_st(int fd, struct stat *st,
+ struct object_directory *odb);
struct commit_graph *read_commit_graph_one(struct repository *r,
struct object_directory *odb);
struct commit_graph *parse_commit_graph(void *graph_map, int fd,