aboutsummaryrefslogtreecommitdiffstats
path: root/git-gui/lib/browser.tcl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-07-12 01:45:56 -0700
committerJunio C Hamano <gitster@pobox.com>2007-07-12 01:45:56 -0700
commit1b2782a5e2f88bf5e6e2cbb58e54fea015e21af5 (patch)
tree19c5485ad50623c4c44d9268fdfa5afa98bd2619 /git-gui/lib/browser.tcl
parentClarify documentation of fast-import's D subcommand (diff)
parentgit-gui: Work around bad interaction between Tcl and cmd.exe on ^{tree} (diff)
downloadgit-1b2782a5e2f88bf5e6e2cbb58e54fea015e21af5.tar.gz
git-1b2782a5e2f88bf5e6e2cbb58e54fea015e21af5.zip
Merge branch 'maint' of git://repo.or.cz/git-gui into maint
* 'maint' of git://repo.or.cz/git-gui: git-gui: Work around bad interaction between Tcl and cmd.exe on ^{tree} git-gui: Don't linewrap within console windows git-gui: Correct ls-tree buffering problem in browser git-gui: Skip nicknames when selecting author initials git-gui: Ensure windows shortcuts always have .bat extension git-gui: Include a Push action on the left toolbar git-gui: Bind M1-P to push action git-gui: Don't bind F5/M1-R in all windows git-gui: Unlock the index when cancelling merge dialog git-gui: properly popup error if gitk should be started but is not installed
Diffstat (limited to 'git-gui/lib/browser.tcl')
-rw-r--r--git-gui/lib/browser.tcl22
1 files changed, 13 insertions, 9 deletions
diff --git a/git-gui/lib/browser.tcl b/git-gui/lib/browser.tcl
index 3d6341bcc5..e612247c9e 100644
--- a/git-gui/lib/browser.tcl
+++ b/git-gui/lib/browser.tcl
@@ -11,6 +11,8 @@ field browser_status {Starting...}
field browser_stack {}
field browser_busy 1
+field ls_buf {}; # Buffered record output from ls-tree
+
constructor new {commit} {
global cursor_ptr M1B
make_toplevel top w
@@ -160,7 +162,7 @@ method _click {was_double_click pos} {
}
method _ls {tree_id {name {}}} {
- set browser_buffer {}
+ set ls_buf {}
set browser_files {}
set browser_busy 1
@@ -185,17 +187,19 @@ method _ls {tree_id {name {}}} {
}
method _read {fd} {
- append browser_buffer [read $fd]
- set pck [split $browser_buffer "\0"]
- set browser_buffer [lindex $pck end]
+ append ls_buf [read $fd]
+ set pck [split $ls_buf "\0"]
+ set ls_buf [lindex $pck end]
set n [llength $browser_files]
$w conf -state normal
foreach p [lrange $pck 0 end-1] {
- set info [split $p "\t"]
- set path [lindex $info 1]
- set info [split [lindex $info 0] { }]
- set type [lindex $info 1]
+ set tab [string first "\t" $p]
+ if {$tab == -1} continue
+
+ set info [split [string range $p 0 [expr {$tab - 1}]] { }]
+ set path [string range $p [expr {$tab + 1}] end]
+ set type [lindex $info 1]
set object [lindex $info 2]
switch -- $type {
@@ -225,7 +229,7 @@ method _read {fd} {
close $fd
set browser_status Ready.
set browser_busy 0
- unset browser_buffer
+ set ls_buf {}
if {$n > 0} {
$w tag add in_sel 1.0 2.0
focus -force $w