test-lib: introduce test_commit_bulk
[gitweb.git] / builtin / commit-graph.c
index 32bcc63427e6c449a436b1fef62a00d920b6355f..537fdfd0f0759e8cce2303af5a197ae77b2b879b 100644 (file)
@@ -62,9 +62,11 @@ static int graph_verify(int argc, const char **argv)
 
        graph_name = get_commit_graph_filename(opts.obj_dir);
        open_ok = open_commit_graph(graph_name, &fd, &st);
-       if (!open_ok)
+       if (!open_ok && errno == ENOENT)
                return 0;
-       graph = load_commit_graph_one_fd_st(graph_name, fd, &st);
+       if (!open_ok)
+               die_errno(_("Could not open commit-graph '%s'"), graph_name);
+       graph = load_commit_graph_one_fd_st(fd, &st);
        FREE_AND_NULL(graph_name);
 
        if (!graph)
@@ -102,7 +104,7 @@ static int graph_read(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(graph_name, fd, &st);
+       graph = load_commit_graph_one_fd_st(fd, &st);
        if (!graph)
                return 1;