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

git-gui: lib/index.tcl: handle files with % in the filename properly

Steps to reproduce the bug: $ mkdir repo && cd repo && git init Initialized empty Git repository in .git/ $ touch 'foo%3Fsuite' $ git-gui Then click on the 'foo%3Fsuite' icon to include it in a changeset, a popup comes with: 'Error: bad field specifier "F"' Vincent Danjean noticed the problem and also suggested the fix, reported through http://bugs.debian.org/441167 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Gerrit Pape committed Sep 7, 2007 at 17:16 UTC 0b883ab30c869c4f22a19e49aedc1604d335cd91
1 file changed +12 -6
lib/index.tcl
+12 -6
@@ -13,7 +13,8 @@ proc update_indexinfo {msg pathList after} {
13 if {$batch > 25} {set batch 25}
14
15 ui_status [format \
16 - "$msg... %i/%i files (%.2f%%)" \
16 + "%s... %i/%i files (%.2f%%)" \
17 + $msg \
18 $update_index_cp \
19 $totalCnt \
20 0.0]
@@ -68,7 +69,8 @@ proc write_update_indexinfo {fd pathList totalCnt batch msg after} {
69 }
70
71 ui_status [format \
71 - "$msg... %i/%i files (%.2f%%)" \
72 + "%s... %i/%i files (%.2f%%)" \
73 + $msg \
74 $update_index_cp \
75 $totalCnt \
76 [expr {100.0 * $update_index_cp / $totalCnt}]]
@@ -86,7 +88,8 @@ proc update_index {msg pathList after} {
88 if {$batch > 25} {set batch 25}
89
90 ui_status [format \
89 - "$msg... %i/%i files (%.2f%%)" \
91 + "%s... %i/%i files (%.2f%%)" \
92 + $msg \
93 $update_index_cp \
94 $totalCnt \
95 0.0]
@@ -145,7 +148,8 @@ proc write_update_index {fd pathList totalCnt batch msg after} {
148 }
149
150 ui_status [format \
148 - "$msg... %i/%i files (%.2f%%)" \
151 + "%s... %i/%i files (%.2f%%)" \
152 + $msg \
153 $update_index_cp \
154 $totalCnt \
155 [expr {100.0 * $update_index_cp / $totalCnt}]]
@@ -163,7 +167,8 @@ proc checkout_index {msg pathList after} {
167 if {$batch > 25} {set batch 25}
168
169 ui_status [format \
166 - "$msg... %i/%i files (%.2f%%)" \
170 + "%s... %i/%i files (%.2f%%)" \
171 + $msg
172 $update_index_cp \
173 $totalCnt \
174 0.0]
@@ -218,7 +223,8 @@ proc write_checkout_index {fd pathList totalCnt batch msg after} {
223 }
224
225 ui_status [format \
221 - "$msg... %i/%i files (%.2f%%)" \
226 + "%s... %i/%i files (%.2f%%)" \
227 + $msg \
228 $update_index_cp \
229 $totalCnt \
230 [expr {100.0 * $update_index_cp / $totalCnt}]]