Skip to content

Commit 8ea36f6

Browse files
spkrkagitster
authored andcommitted
commit-graph: propagate topo_levels slab to all chain layers
The topo_levels slab is only propagated to the topmost graph layer instead of all layers in the chain. Commits from lower layers appear to have no generation numbers, so the DFS re-walks the entire ancestry. Fix by making topo_levels visible to all layers, not just the first one. Signed-off-by: Kristofer Karlsson <krka@spotify.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 02d62c3 commit 8ea36f6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

commit-graph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2610,7 +2610,7 @@ int write_commit_graph(struct odb_source *source,
26102610

26112611
g = prepare_commit_graph(ctx.r);
26122612
for (struct commit_graph *chain = g; chain; chain = chain->base_graph)
2613-
g->topo_levels = &topo_levels;
2613+
chain->topo_levels = &topo_levels;
26142614

26152615
if (flags & COMMIT_GRAPH_WRITE_BLOOM_FILTERS)
26162616
ctx.changed_paths = 1;

t/t5324-split-commit-graph.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ test_expect_success 'write generation data chunk when commit-graph chain is repl
718718
)
719719
'
720720

721-
test_expect_failure 'incremental write reads topo levels from all layers' '
721+
test_expect_success 'incremental write reads topo levels from all layers' '
722722
git init topo-from-lower &&
723723
(
724724
cd topo-from-lower &&

0 commit comments

Comments
 (0)