git-am: fix shell quoting
Noticed by Stephan Beyer; the new test is mine. Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
b47dfe9e9c
commit
17f26a9ee3
|
@ -38,7 +38,7 @@ sq () {
|
||||||
for sqarg
|
for sqarg
|
||||||
do
|
do
|
||||||
printf "%s" "$sqarg" |
|
printf "%s" "$sqarg" |
|
||||||
sed -e 's/'\''/'\''\'\'''\''/g' -e 's/.*/ '\''&'\''/'
|
sed -e 's/'\''/'\''\\'\'''\''/g' -e 's/.*/ '\''&'\''/'
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,4 +58,12 @@ test_expect_success 'interrupted am --directory="frotz nitfol"' '
|
||||||
grep One "frotz nitfol/file-5"
|
grep One "frotz nitfol/file-5"
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'apply to a funny path' '
|
||||||
|
with_sq="with'\''sq"
|
||||||
|
rm -fr .git/rebase-apply &&
|
||||||
|
git reset --hard initial &&
|
||||||
|
git am --directory="$with_sq" "$tm"/am-test-5-2 &&
|
||||||
|
test -f "$with_sq/file-5"
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in New Issue