mirror of
https://github.com/git/git.git
synced 2026-02-22 15:51:29 +00:00
Makefile: fix shell quoting
Makefile records paths to a few programs in GIT-BUILD-OPTIONS file. These
paths need to be quoted twice: once to protect specials from the shell
that runs the generated GIT-BUILD-OPTIONS file, and again to protect them
(and the first level of quoting itself) from the shell that runs the
"echo" inside the Makefile.
You can test this by trying:
$ ln -s /bin/tar "$HOME/Tes' program/tar"
$ make TAR="$HOME/Tes' program/tar" test
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@@ -67,7 +67,7 @@ test_expect_success \
|
||||
test_expect_success \
|
||||
'validate file modification time' \
|
||||
'mkdir extract &&
|
||||
$TAR xf b.tar -C extract a/a &&
|
||||
"$TAR" xf b.tar -C extract a/a &&
|
||||
perl -e '\''print((stat("extract/a/a"))[9], "\n")'\'' >b.mtime &&
|
||||
echo "1117231200" >expected.mtime &&
|
||||
diff expected.mtime b.mtime'
|
||||
@@ -79,7 +79,7 @@ test_expect_success \
|
||||
|
||||
test_expect_success \
|
||||
'extract tar archive' \
|
||||
'(cd b && $TAR xf -) <b.tar'
|
||||
'(cd b && "$TAR" xf -) <b.tar'
|
||||
|
||||
test_expect_success \
|
||||
'validate filenames' \
|
||||
@@ -96,7 +96,7 @@ test_expect_success \
|
||||
|
||||
test_expect_success \
|
||||
'extract tar archive with prefix' \
|
||||
'(cd c && $TAR xf -) <c.tar'
|
||||
'(cd c && "$TAR" xf -) <c.tar'
|
||||
|
||||
test_expect_success \
|
||||
'validate filenames with prefix' \
|
||||
@@ -116,7 +116,7 @@ test_expect_success \
|
||||
|
||||
test_expect_success \
|
||||
'extract substfiles' \
|
||||
'(mkdir f && cd f && $TAR xf -) <f.tar'
|
||||
'(mkdir f && cd f && "$TAR" xf -) <f.tar'
|
||||
|
||||
test_expect_success \
|
||||
'validate substfile contents' \
|
||||
@@ -128,7 +128,7 @@ test_expect_success \
|
||||
|
||||
test_expect_success \
|
||||
'extract substfiles from archive with prefix' \
|
||||
'(mkdir g && cd g && $TAR xf -) <g.tar'
|
||||
'(mkdir g && cd g && "$TAR" xf -) <g.tar'
|
||||
|
||||
test_expect_success \
|
||||
'validate substfile contents from archive with prefix' \
|
||||
|
||||
Reference in New Issue
Block a user