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 <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Taylor Blau
2020-02-03 13:18:04 -08:00
committed by Junio C Hamano
parent ad2dd5bb63
commit a7df60cac8
4 changed files with 14 additions and 14 deletions

View File

@ -22,7 +22,7 @@ int cmd__read_graph(int argc, const char **argv)
if (!open_ok)
die_errno(_("Could not open commit-graph '%s'"), graph_name);
graph = load_commit_graph_one_fd_st(fd, &st);
graph = load_commit_graph_one_fd_st(fd, &st, odb);
if (!graph)
return 1;