fix previous: last entry returned by graph iteration was duplicated
diff --git a/lib/commit_graph.c b/lib/commit_graph.c
index ce50bb5..f71dade 100644
--- a/lib/commit_graph.c
+++ b/lib/commit_graph.c
@@ -720,10 +720,9 @@ got_commit_graph_iter_next(struct got_object_id **id,
if (graph->iter_node ==
TAILQ_LAST(&graph->iter_list, got_commit_graph_iter_list) &&
got_object_idset_num_elements(graph->open_branches) == 0) {
- *id = &graph->iter_node->id;
/* We are done iterating. */
graph->iter_node = NULL;
- return NULL;
+ return got_error(GOT_ERR_ITER_COMPLETED);
}
if (TAILQ_NEXT(graph->iter_node, entry) == NULL)