]> Kevux Git Server - rit/commitdiff
revision: parse parent in indegree_walk_step()
authorAbhishek Kumar <abhishekkumar8222@gmail.com>
Sat, 16 Jan 2021 18:11:09 +0000 (18:11 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Jan 2021 00:21:18 +0000 (16:21 -0800)
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>
revision.c

index 9dff845..de8e45f 100644 (file)
@@ -3373,6 +3373,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)
                        (*pi)++;
                else