Commit bfd1f6daa47c07c6796399a53b51437436cc81b5

Stefan Sperling 2018-11-05T16:59:42

init commit timestamp earlier in commit graph's add_node()

diff --git a/lib/commit_graph.c b/lib/commit_graph.c
index ea37d8d..a674658 100644
--- a/lib/commit_graph.c
+++ b/lib/commit_graph.c
@@ -406,6 +406,7 @@ add_node(struct got_commit_graph_node **new_node,
 		}
 		node->nparents++;
 	}
+	node->commit_timestamp = commit->committer_time;
 
 	err = got_object_idset_add(graph->node_ids, &node->id, node);
 	if (err) {
@@ -429,12 +430,6 @@ add_node(struct got_commit_graph_node **new_node,
 		}
 	}
 
-	node->commit_timestamp = commit->committer_time;
-	if (node->commit_timestamp == -1) {
-		free_node(node);
-		return got_error_from_errno();
-	}
-
 	if (changed)
 		add_node_to_iter_list(graph, node, child_node);