Skip to content

Commit 17529cf

Browse files
committed
gitk: Fix a bug in make_disporder
The make_disporder function has an optimization where it assumed that if displayorder was already long enough and the first entry in it for a particular arc was non-null, then the whole arc was present. This turns out not to be true in some circumstances, since we can add a commit to an arc (which truncates displayorder to the previous end of that arc), then call make_disporder for later arcs (which will pad displayorder with null elements), then call make_disporder for the first arc - which won't update the null elements. This fixes it by changing the optimization to check the last element for the arc instead of the first. Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 5be25a8 commit 17529cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gitk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ proc make_disporder {start end} {
853853
lappend displayorder $id
854854
lappend parentlist $parents($curview,$id)
855855
}
856-
} elseif {[lindex $displayorder $r] eq {}} {
856+
} elseif {[lindex $displayorder [expr {$r + $al - 1}]] eq {}} {
857857
set i $r
858858
foreach id $varccommits($curview,$a) {
859859
lset displayorder $i $id

0 commit comments

Comments
 (0)