Skip to content

Commit 841ea82

Browse files
committed
gitk: Fix bug where arcs could get lost
Because we weren't fixing up vlastins when moving an arc from one place to another, it was possible for us later to decide to move an arc to the wrong place, and end up with an arc disconnected from the rest of the graph. This fixes it by updating vlastins when necessary. Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 585fb59 commit 841ea82

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gitk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,12 @@ proc splitvarc {p v} {
415415
set varcid($v,$id) $na
416416
}
417417
lappend vdownptr($v) [lindex $vdownptr($v) $oa]
418+
lappend vlastins($v) [lindex $vlastins($v) $oa]
418419
lset vdownptr($v) $oa $na
420+
lset vlastins($v) $oa 0
419421
lappend vupptr($v) $oa
420422
lappend vleftptr($v) 0
421423
lappend vbackptr($v) 0
422-
lappend vlastins($v) 0
423424
for {set b [lindex $vdownptr($v) $na]} {$b != 0} {set b [lindex $vleftptr($v) $b]} {
424425
lset vupptr($v) $b $na
425426
}
@@ -513,6 +514,9 @@ proc renumbervarc {a v} {
513514
if {$d != 0} {
514515
lset vbackptr($v) $d $c
515516
}
517+
if {[lindex $vlastins($v) $b] == $a} {
518+
lset vlastins($v) $b $c
519+
}
516520
lset vupptr($v) $a $ka
517521
set c [lindex $vlastins($v) $ka]
518522
if {$c == 0 || \

0 commit comments

Comments
 (0)