[PATCH] gitk: Fix for tree view ending in nested directories
Unroll the prefix stack when assigning treeheights when leaving proc treeview. Previously, when the ls-tree output ended in multiple nested directories (for instance in a repository with a single file "foo/bar/baz"), $treeheight("foo/bar/") was assigned twice, and $treeheight("foo/") was never assigned. This led to an error when expanding the "foo" directory in the gitk treeview. Signed-off-by: Brian Downing <bdowning@lavos.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
Brian Downing committed
Jul 5, 2007 at 06:33 UTC
096e96b493bfc30687c87b303b93e75864942786
1 file changed
+3
gitk
+3
@@ -1216,6 +1216,9 @@ proc treeview {w l openlevs} {
1216
set treeheight($prefix) $ht
1217
incr ht [lindex $htstack end]
1218
set htstack [lreplace $htstack end end]
1219
+ set prefixend [lindex $prefendstack end]
1220
+ set prefendstack [lreplace $prefendstack end end]
1221
+ set prefix [string range $prefix 0 $prefixend]
1222
}
1223
$w conf -state disabled
1224
}