revision: parse parent in indegree_walk_step()

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> Reviewed-by: Taylor Blau <me@ttaylorr.com> Reviewed-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Abhishek Kumar committed Jan 16, 2021 at 18:11 UTC 2f9bbb6d91cfd72028cd930ab7e19d5d4903e58a
1 file changed +3
revision.c
+3
@@ -3373,6 +3373,9 @@ static void indegree_walk_step(struct rev_info *revs)
3373 struct commit *parent = p->item;
3374 int *pi = indegree_slab_at(&info->indegree, parent);
3375
3376 + if (repo_parse_commit_gently(revs->repo, parent, 1) < 0)
3377 + return;
3378 +
3379 if (*pi)
3380 (*pi)++;
3381 else