{"thread":{"id":"8870","subject":"[PATCH] gitk: Fix for tree view ending in nested directories","startedAt":"2007-07-04T21:26:44Z","lastAt":"2007-07-04T21:26:44Z","messageCount":1,"participants":["Brian Downing"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"46516","messageId":"20070704212643.GR4087@lavos.net","threadId":"8870","inReplyTo":null,"subject":"[PATCH] gitk: Fix for tree view ending in nested directories","fromName":"Brian Downing","fromEmail":"bdowning@lavos.net","sentAt":"2007-07-04T21:26:44Z","receivedAt":"2007-07-04T21:26:44Z","isPatch":true,"sender":{"key":"bdowning@lavos.net","avatar":"https://avatars.githubusercontent.com/u/366426?v=4"},"body":"Unroll the prefix stack when assigning treeheights when leaving\nproc treeview.  Previously, when the ls-tree output ended in\nmultiple nested directories (for instance in a repository with a\nsingle file \"foo/bar/baz\"), $treeheight(\"foo/bar/\") was assigned\ntwice, and $treeheight(\"foo/\") was never assigned.  This led to\nan error when expanding the \"foo\" directory in the gitk treeview.\n\nSigned-off-by: Brian Downing <bdowning@lavos.net>\n---\n gitk |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 2d6a6ef..d94c512 100755\n--- a/gitk\n+++ b/gitk\n@@ -1216,6 +1216,9 @@ proc treeview {w l openlevs} {\n \tset treeheight($prefix) $ht\n \tincr ht [lindex $htstack end]\n \tset htstack [lreplace $htstack end end]\n+\tset prefixend [lindex $prefendstack end]\n+\tset prefendstack [lreplace $prefendstack end end]\n+\tset prefix [string range $prefix 0 $prefixend]\n     }\n     $w conf -state disabled\n }\n-- \n1.5.2.GIT\n"}]}