commit ce47a424491a18ce7fec45cd7b3ab08f568c90d6 from: Stefan Sperling date: Sun Jul 22 11:52:36 2018 UTC treat double-linking to same child in commit graph as no-op commit - e0d42f609a25f032fe7b71d540dc343013c0a92b commit + ce47a424491a18ce7fec45cd7b3ab08f568c90d6 blob - e973de6181ecc3d2fe1b5be6836948d252ec8279 blob + 2c10f94ec0af1f680f3797b95bbf57ad19ef579d --- lib/commit_graph.c +++ lib/commit_graph.c @@ -307,10 +307,10 @@ add_node(struct got_commit_graph_node **new_node, if (got_object_id_cmp(commit_id, &child_node->id) == 0) return got_error(GOT_ERR_BAD_OBJ_ID); - /* Prevent double-linking to the same child. */ + /* Prevent double-linking to the same child (treat as no-op). */ SIMPLEQ_FOREACH(cid, &node->child_ids, entry) { if (got_object_id_cmp(cid->id, &child_node->id) == 0) - return got_error(GOT_ERR_BAD_OBJ_ID); + return NULL; } err = add_vertex(&node->child_ids, &child_node->id);