Skip to content

Commit

Permalink
git-mergetool: print filename when it contains %
Browse files Browse the repository at this point in the history
If git-mergetool was invoked with files with a percent sign (%) in
their names, it would print an error.  For example, if you were
calling mergetool on a file called "%2F":

    printf: %2F: invalid directive

Do not pass random string to printf as if it were a valid format.
Use format string "%s" and pass the string as data to be formatted
instead.

Signed-off-by: Asheesh Laroia <asheesh@asheesh.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Asheesh Laroia authored and Junio C Hamano committed Feb 8, 2013
1 parent 7e20105 commit 59cf706
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-mergetool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ then
fi

printf "Merging:\n"
printf "$files\n"
printf "%s\n" "$files"

IFS='
'
Expand Down

0 comments on commit 59cf706

Please sign in to comment.