Commit Diff


commit - ca2dc7e62d06f5cec97935e55d8a7957f3495fa3
commit + 6e0c0f9a81a38c2f4b56459cec187556cf8e06ff
blob - 66ff21914d95378799637e273fbee6d186886c7b
blob + a480124dc389f0f0d1ba76dbb7d7361d8b73df5a
--- include/got_commit_graph.h
+++ 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 *);
blob - cebac9ef1e0aa411ce1ae56ca5f9b2c8689bb56e
blob + 23f278fc874c54ac76978033644df98a27a77457
--- lib/commit_graph.c
+++ 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);
-}