git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitk: Fix for tree view ending in nested directories
@ 2007-07-04 21:26 Brian Downing
  0 siblings, 0 replies; only message in thread
From: Brian Downing @ 2007-07-04 21:26 UTC (permalink / raw)
  To: git

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>
---
 gitk |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/gitk b/gitk
index 2d6a6ef..d94c512 100755
--- a/gitk
+++ b/gitk
@@ -1216,6 +1216,9 @@ proc treeview {w l openlevs} {
 	set treeheight($prefix) $ht
 	incr ht [lindex $htstack end]
 	set htstack [lreplace $htstack end end]
+	set prefixend [lindex $prefendstack end]
+	set prefendstack [lreplace $prefendstack end end]
+	set prefix [string range $prefix 0 $prefixend]
     }
     $w conf -state disabled
 }
-- 
1.5.2.GIT

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-04 21:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-04 21:26 [PATCH] gitk: Fix for tree view ending in nested directories Brian Downing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).