commit 6a4c18905deaa2e3c0663558d5016e475e5f64c6 from: Stefan Sperling date: Mon Jun 11 12:23:42 2018 UTC introduce got_commit_graph_contains_object commit - f8e900f3dec31fd1b679afff508f7c5e33d73956 commit + 6a4c18905deaa2e3c0663558d5016e475e5f64c6 blob - f18494c277639e3309b913730db9293bd006b329 blob + c97734f128a3241b6703a2527f97435adb065fee --- include/got_commit_graph.h +++ include/got_commit_graph.h @@ -27,3 +27,6 @@ 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 - 89f1d2c9389a5e07131a9dc00c552169926ab022 blob + 50d6b3525980bc150e9543c63e08fcc549b7cd03 --- lib/commit_graph.c +++ lib/commit_graph.c @@ -466,3 +466,10 @@ 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); +}