diff mbox series

[v7,02/11] revision: parse parent in indegree_walk_step()

Message ID 90ca0a1fd697b91180a01d82eeaed54511c9719f.1612162726.git.gitgitgadget@gmail.com (mailing list archive)
State Accepted
Commit 2f9bbb6d91cfd72028cd930ab7e19d5d4903e58a
Headers show
Series Implement Corrected Commit Date | expand

Commit Message

Abhishek Kumar Feb. 1, 2021, 6:58 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(+)
diff mbox series


diff --git a/revision.c b/revision.c
index 0b5c7231401..5474001331a 100644
--- a/revision.c
+++ b/revision.c
@@ -3399,6 +3399,9 @@  static void indegree_walk_step(struct rev_info *revs)
 		struct commit *parent = p->item;
 		int *pi = indegree_slab_at(&info->indegree, parent);
+		if (repo_parse_commit_gently(revs->repo, parent, 1) < 0)
+			return;
 		if (*pi)