git-am: fix shell quoting

Noticed by Stephan Beyer; the new test is mine.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2009-01-14 16:29:59 -08:00
parent b47dfe9e9c
commit 17f26a9ee3
2 changed files with 9 additions and 1 deletions

View File

@ -38,7 +38,7 @@ sq () {
for sqarg
do
printf "%s" "$sqarg" |
sed -e 's/'\''/'\''\'\'''\''/g' -e 's/.*/ '\''&'\''/'
sed -e 's/'\''/'\''\\'\'''\''/g' -e 's/.*/ '\''&'\''/'
done
}