remove got_commit_graph_contains_object() Put equivalent functionality into fetch_commits_up_to() instead.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/include/got_commit_graph.h b/include/got_commit_graph.h
index 66ff219..a480124 100644
--- a/include/got_commit_graph.h
+++ b/include/got_commit_graph.h
@@ -29,6 +29,3 @@ const struct got_error *got_commit_graph_iter_start(
struct got_commit_graph *, struct got_object_id *);
const struct got_error *got_commit_graph_iter_next(struct got_object_id **,
struct got_commit_graph *);
-
-int got_commit_graph_contains_object(struct got_commit_graph *,
- struct got_object_id *);
diff --git a/lib/commit_graph.c b/lib/commit_graph.c
index cebac9e..23f278f 100644
--- a/lib/commit_graph.c
+++ b/lib/commit_graph.c
@@ -402,6 +402,10 @@ got_commit_graph_fetch_commits_up_to(int *nfetched,
int ncommits, wanted_id_added = 0;
*nfetched = 0;
+
+ if (got_object_idset_get(graph->node_ids, wanted_id) != NULL)
+ return NULL;
+
while (!wanted_id_added) {
err = fetch_commits_from_open_branches(&ncommits,
&wanted_id_added, graph, repo, wanted_id);
@@ -493,10 +497,3 @@ got_commit_graph_iter_next(struct got_object_id **id,
graph->iter_node = node;
return NULL;
}
-
-int
-got_commit_graph_contains_object(struct got_commit_graph *graph,
- struct got_object_id *id)
-{
- return (got_object_idset_get(graph->node_ids, id) != NULL);
-}