Commits

Anonymous committed 0b883ab

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>

  • Participants
  • Parent commits 047d94d

Comments (0)

Files changed (1)

File lib/index.tcl

 	if {$batch > 25} {set batch 25}
 
 	ui_status [format \
-		"$msg... %i/%i files (%.2f%%)" \
+		"%s... %i/%i files (%.2f%%)" \
+		$msg \
 		$update_index_cp \
 		$totalCnt \
 		0.0]
 	}
 
 	ui_status [format \
-		"$msg... %i/%i files (%.2f%%)" \
+		"%s... %i/%i files (%.2f%%)" \
+		$msg \
 		$update_index_cp \
 		$totalCnt \
 		[expr {100.0 * $update_index_cp / $totalCnt}]]
 	if {$batch > 25} {set batch 25}
 
 	ui_status [format \
-		"$msg... %i/%i files (%.2f%%)" \
+		"%s... %i/%i files (%.2f%%)" \
+		$msg \
 		$update_index_cp \
 		$totalCnt \
 		0.0]
 	}
 
 	ui_status [format \
-		"$msg... %i/%i files (%.2f%%)" \
+		"%s... %i/%i files (%.2f%%)" \
+		$msg \
 		$update_index_cp \
 		$totalCnt \
 		[expr {100.0 * $update_index_cp / $totalCnt}]]
 	if {$batch > 25} {set batch 25}
 
 	ui_status [format \
-		"$msg... %i/%i files (%.2f%%)" \
+		"%s... %i/%i files (%.2f%%)" \
+		$msg
 		$update_index_cp \
 		$totalCnt \
 		0.0]
 	}
 
 	ui_status [format \
-		"$msg... %i/%i files (%.2f%%)" \
+		"%s... %i/%i files (%.2f%%)" \
+		$msg \
 		$update_index_cp \
 		$totalCnt \
 		[expr {100.0 * $update_index_cp / $totalCnt}]]