@matheusbsbs / matheus-bagliano / commits / bea6878be2
Fork 0

git-gui: Handle progress bars from newer gits

Post Git 1.5.3 a new style progress bar has been introduced that uses only one line rather than two. The formatting of the completed and total section is also slightly different so we must adjust our regexp to match. Unfortunately both styles are in active use by different versions of Git so we need to look for both. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Oct 20, 2007 at 14:16 UTC bea6878be2fb73e50407f93f2bcd71b961510c19
1 file changed +4 -1
lib/status_bar.tcl
+4 -1
@@ -69,7 +69,10 @@ method update_meter {buf} {
69
70 set prior [string range $meter 0 $r]
71 set meter [string range $meter [expr {$r + 1}] end]
72 - if {[regexp "\\((\\d+)/(\\d+)\\)\\s+done\r\$" $prior _j a b]} {
72 + set p "\\((\\d+)/(\\d+)\\)"
73 + if {[regexp ":\\s*\\d+% $p\(?:, done.\\s*\n|\\s*\r)\$" $prior _j a b]} {
74 + update $this $a $b
75 + } elseif {[regexp "$p\\s+done\r\$" $prior _j a b]} {
76 update $this $a $b
77 }
78 }