Code

Merge branch 'maint'
authorShawn O. Pearce <spearce@spearce.org>
Sun, 21 Oct 2007 00:43:36 +0000 (20:43 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Sun, 21 Oct 2007 00:43:36 +0000 (20:43 -0400)
* maint:
  git-gui: Don't display CR within console windows
  git-gui: Handle progress bars from newer gits
  git-gui: Correctly report failures from git-write-tree

Conflicts:

lib/commit.tcl
lib/console.tcl

lib/commit.tcl
lib/console.tcl
lib/status_bar.tcl

index 7099f5c6f79a72e75b83cfdc7432249476c492cb..10b0430f54863111268a4b67364cbc678b0eb50d 100644 (file)
@@ -253,7 +253,7 @@ proc commit_committree {fd_wt curHEAD msg} {
        global repo_config
 
        gets $fd_wt tree_id
-       if {$tree_id eq {} || [catch {close $fd_wt} err]} {
+       if {[catch {close $fd_wt} err]} {
                error_popup [strcat [mc "write-tree failed:"] "\n\n$err"]
                ui_status {Commit failed.}
                unlock_index
index 2075374683a49dd8a955e52c76d951ec3013536b..5597188d803a1c8217011412a39c14fbbeaf0b3a 100644 (file)
@@ -120,7 +120,7 @@ method _read {fd after} {
                        } else {
                                $w_t delete $console_cr end
                                $w_t insert end "\n"
-                               $w_t insert end [string range $buf $c $cr]
+                               $w_t insert end [string range $buf $c [expr {$cr - 1}]]
                                set c $cr
                                incr c
                        }
index 5c5bf7c731738db2bba607384715f5ab4fceba25..51d4177551b911c35cfd8004a36fca4259367d24 100644 (file)
@@ -97,7 +97,10 @@ method update_meter {buf} {
 
        set prior [string range $meter 0 $r]
        set meter [string range $meter [expr {$r + 1}] end]
-       if {[regexp "\\((\\d+)/(\\d+)\\)\\s+done\r\$" $prior _j a b]} {
+       set p "\\((\\d+)/(\\d+)\\)"
+       if {[regexp ":\\s*\\d+% $p\(?:, done.\\s*\n|\\s*\r)\$" $prior _j a b]} {
+               update $this $a $b
+       } elseif {[regexp "$p\\s+done\r\$" $prior _j a b]} {
                update $this $a $b
        }
 }