Commit cb3528126b0c316de49661eb97920112c6e997c4

Stefan Sperling 2018-07-22T14:08:45

callers of add_node() don't need to check for GOT_ERR_OBJ_EXISTS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/lib/commit_graph.c b/lib/commit_graph.c
index 2c10f94..99ba3e3 100644
--- a/lib/commit_graph.c
+++ b/lib/commit_graph.c
@@ -418,11 +418,8 @@ fetch_commits_from_open_branches(int *ncommits, int *wanted_id_added,
 
 		err = add_node(&new_node, graph, commit_id, commit, child_node);
 		got_object_commit_close(commit);
-		if (err) {
-			if (err->code != GOT_ERR_OBJ_EXISTS)
-				break;
-			err = NULL;
-		}
+		if (err)
+			break;
 		if (new_node)
 			(*ncommits)++;
 		if (wanted_id && got_object_id_cmp(commit_id, wanted_id) == 0)