commit - 57eecd46cb6d54281927e44797500c40628310c3
commit + 8e29169599cbcb1a6fd1c41a62dc3ccab59c5023
blob - cddffc3307140c923d37d31e933d3b0988c24644
blob + 68baeaeec71b77bcca931867387954a7a7ea4e85
--- lib/commit_graph.c
+++ lib/commit_graph.c
if (graph->flags & GOT_COMMIT_GRAPH_FIRST_PARENT_TRAVERSAL) {
qid = SIMPLEQ_FIRST(&commit->parent_ids);
if (qid == NULL ||
- got_object_idset_get(graph->open_branches, qid->id))
+ got_object_idset_contains(graph->open_branches, qid->id))
return NULL;
return got_object_idset_add(graph->open_branches,
- qid->id, node);
+ qid->id, NULL);
}
/*
SIMPLEQ_FOREACH(qid, &commit->parent_ids, entry) {
struct got_object_id *id;
- if (got_object_idset_get(graph->open_branches, qid->id))
+ if (got_object_idset_contains(graph->open_branches,
+ qid->id))
continue;
err = got_object_id_by_path(&id, repo, qid->id,
*/
if (got_object_id_cmp(merged_id, id) == 0) {
err = got_object_idset_add(graph->open_branches,
- qid->id, node);
+ qid->id, NULL);
free(merged_id);
free(id);
return err;
qid = SIMPLEQ_FIRST(&commit->parent_ids);
if (qid == NULL)
return NULL;
- if (got_object_idset_get(graph->open_branches, qid->id))
+ if (got_object_idset_contains(graph->open_branches,
+ qid->id))
return NULL;
- if (got_object_idset_get(graph->node_ids, qid->id))
+ if (got_object_idset_contains(graph->node_ids,
+ qid->id))
return NULL; /* parent already traversed */
return got_object_idset_add(graph->open_branches,
- qid->id, node);
+ qid->id, NULL);
}
}
SIMPLEQ_FOREACH(qid, &commit->parent_ids, entry) {
- if (got_object_idset_get(graph->open_branches, qid->id))
+ if (got_object_idset_contains(graph->open_branches, qid->id))
continue;
- if (got_object_idset_get(graph->node_ids, qid->id))
+ if (got_object_idset_contains(graph->node_ids, qid->id))
continue; /* parent already traversed */
- err = got_object_idset_add(graph->open_branches, qid->id, node);
+ err = got_object_idset_add(graph->open_branches, qid->id, NULL);
if (err)
return err;
}
memcpy(&node->id, commit_id, sizeof(node->id));
node->timestamp = commit->committer_time;
- err = got_object_idset_add(graph->node_ids, &node->id, node);
+ err = got_object_idset_add(graph->node_ids, &node->id, NULL);
if (err)
free(node);
else
return err;
}
-static const struct got_error *
-free_node_iter(struct got_object_id *id, void *data, void *arg)
-{
- struct got_commit_graph_node *node = data;
- free(node);
- return NULL;
-}
-
void
got_commit_graph_close(struct got_commit_graph *graph)
{
if (graph->open_branches)
got_object_idset_free(graph->open_branches);
- got_object_idset_for_each(graph->node_ids, free_node_iter, NULL);
if (graph->node_ids)
got_object_idset_free(graph->node_ids);
free(graph->tips);
}
if (id) {
- if (got_object_idset_get(commit_ids, id)) {
+ if (got_object_idset_contains(commit_ids, id)) {
*yca_id = got_object_id_dup(id);
if (*yca_id)
break;
break;
}
- err = got_object_idset_add(commit_ids, id, id);
+ err = got_object_idset_add(commit_ids, id, NULL);
if (err)
break;
}
if (id2) {
- if (got_object_idset_get(commit_ids, id2)) {
+ if (got_object_idset_contains(commit_ids, id2)) {
*yca_id = got_object_id_dup(id2);
if (*yca_id)
break;
break;
}
- err = got_object_idset_add(commit_ids, id2, id2);
+ err = got_object_idset_add(commit_ids, id2, NULL);
if (err)
break;
}