commit - 191379307b0c8d7c44e8b958cce3288b86b54d7e
commit + 58e5f354035040c9e6fd3d29cfda7bbe9a700a2e
blob - 9f0c3c9a7ab7018ee59cef631cc0d19eeb453e01
blob + 2fca28a4074d95d8a0dc869fc4217dca43892bb4
--- lib/commit_graph.c
+++ lib/commit_graph.c
return;
}
- /*
- * If a child node is known, begin looping over the list there
- * instead of beginning from the list head. Parent commits are
- * traversed before their children.
- */
- n = child_node ? child_node : TAILQ_FIRST(&graph->iter_list);
-
/* Ensure that an iteration in progress will see this new commit. */
if (graph->iter_node) {
n = graph->iter_node;
- do {
+ while (n) {
next = TAILQ_NEXT(n, entry);
if (next &&
node->commit_timestamp >= next->commit_timestamp) {
return;
}
n = next;
- } while (next);
-
+ }
TAILQ_INSERT_AFTER(&graph->iter_list, graph->iter_node,
node, entry);
return;
}
+ /*
+ * If a child node is known, begin looping over the list there
+ * instead of beginning from the list head. Parent commits are
+ * traversed before their children.
+ */
+ n = child_node ? child_node : TAILQ_FIRST(&graph->iter_list);
+
/* Insert into list based on committer timestamp. */
do {
if (node->commit_timestamp == n->commit_timestamp) {