[v2,02/10] revision: parse parent in indegree_walk_step()
diff mbox series

Message ID cf61239f9332a9cd91110a9b6319b1133ff3bd27.1596941624.git.gitgitgadget@gmail.com
State New
Headers show
Series
  • Implement Corrected Commit Date
Related show

Commit Message

Johannes Schindelin via GitGitGadget Aug. 9, 2020, 2:53 a.m. UTC
From: Abhishek Kumar <abhishekkumar8222@gmail.com>

In indegree_walk_step(), we add unvisited parents to the indegree queue.
However, parents are not guaranteed to be parsed. As the indegree queue
sorts by generation number, let's parse parents before inserting them to
ensure the correct priority order.

Signed-off-by: Abhishek Kumar <abhishekkumar8222@gmail.com>
---
 revision.c | 3 +++
 1 file changed, 3 insertions(+)

Patch
diff mbox series

diff --git a/revision.c b/revision.c
index 6de29cdf7a..4ec82ed5ab 100644
--- a/revision.c
+++ b/revision.c
@@ -3365,6 +3365,9 @@  static void indegree_walk_step(struct rev_info *revs)
 		struct commit *parent = p->item;
 		int *pi = indegree_slab_at(&info->indegree, parent);
 
+		if (parse_commit_gently(parent, 1) < 0)
+			return;
+
 		if (*pi)
 			(*pi)++;
 		else