@matheusbsbs / matheus-bagliano / commits / 17529cf9bc
Fork 0

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>

Paul Mackerras committed Jan 12, 2008 at 21:46 UTC 17529cf9bc50e8b2bc0ea930a966b8b47056853e
1 file changed +1 -1
gitk
+1 -1
@@ -853,7 +853,7 @@ proc make_disporder {start end} {
853 lappend displayorder $id
854 lappend parentlist $parents($curview,$id)
855 }
856 - } elseif {[lindex $displayorder $r] eq {}} {
856 + } elseif {[lindex $displayorder [expr {$r + $al - 1}]] eq {}} {
857 set i $r
858 foreach id $varccommits($curview,$a) {
859 lset displayorder $i $id