Fix tests breaking when checkout path contains shell metacharacters

This fixes the remainder of the issues where the test script itself is at
fault for failing when the git checkout path contains whitespace or other
shell metacharacters.

The majority of git svn tests used the idiom

  test_expect_success "title" "test script using $svnrepo"

These were changed to have the test script in single-quotes:

  test_expect_success "title" 'test script using "$svnrepo"'

which unfortunately makes the patch appear larger than it really is.

One consequence of this change is that in the verbose test output the
value of $svnrepo (and in some cases other variables, too) is no
longer expanded, i.e. previously we saw

  * expecting success:
	test script using /path/to/git/t/trash/svnrepo

but now it is:

  * expecting success:
	test script using "$svnrepo"

Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Bryan Donlan
2008-05-04 01:37:59 -04:00
committed by Junio C Hamano
parent 0e46e70462
commit f69e836fab
39 changed files with 475 additions and 469 deletions

View File

@ -19,6 +19,9 @@ cp FAKE_MSG "$1"
exit 0
EOF
chmod +x fake-editor
## Not using test_set_editor here so we can easily ensure the editor variable
## is only set for the editor tests
FAKE_EDITOR="$(pwd)/fake-editor"
export FAKE_EDITOR
@ -27,7 +30,7 @@ test_expect_success 'with no hook (editor)' '
echo "more foo" >> file &&
git add file &&
echo "more foo" > FAKE_MSG &&
GIT_EDITOR="$FAKE_EDITOR" git commit
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit
'
@ -44,7 +47,7 @@ test_expect_success '--no-verify with no hook (editor)' '
echo "more bar" > file &&
git add file &&
echo "more bar" > FAKE_MSG &&
GIT_EDITOR="$FAKE_EDITOR" git commit --no-verify
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify
'
@ -71,7 +74,7 @@ test_expect_success 'with succeeding hook (editor)' '
echo "more more" >> file &&
git add file &&
echo "more more" > FAKE_MSG &&
GIT_EDITOR="$FAKE_EDITOR" git commit
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit
'
@ -88,7 +91,7 @@ test_expect_success '--no-verify with succeeding hook (editor)' '
echo "even more more" >> file &&
git add file &&
echo "even more more" > FAKE_MSG &&
GIT_EDITOR="$FAKE_EDITOR" git commit --no-verify
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify
'
@ -111,7 +114,7 @@ test_expect_success 'with failing hook (editor)' '
echo "more another" >> file &&
git add file &&
echo "more another" > FAKE_MSG &&
! (GIT_EDITOR="$FAKE_EDITOR" git commit)
! (GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit)
'
@ -128,7 +131,7 @@ test_expect_success '--no-verify with failing hook (editor)' '
echo "more stuff" >> file &&
git add file &&
echo "more stuff" > FAKE_MSG &&
GIT_EDITOR="$FAKE_EDITOR" git commit --no-verify
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify
'
@ -146,7 +149,7 @@ test_expect_success 'with non-executable hook (editor)' '
echo "content again" >> file &&
git add file &&
echo "content again" > FAKE_MSG &&
GIT_EDITOR="$FAKE_EDITOR" git commit -m "content again"
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit -m "content again"
'
@ -163,7 +166,7 @@ test_expect_success '--no-verify with non-executable hook (editor)' '
echo "even more content" >> file &&
git add file &&
echo "even more content" > FAKE_MSG &&
GIT_EDITOR="$FAKE_EDITOR" git commit --no-verify
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify
'
@ -193,7 +196,7 @@ test_expect_success 'hook edits commit message (editor)' '
echo "additional content" >> file &&
git add file &&
echo "additional content" > FAKE_MSG &&
GIT_EDITOR="$FAKE_EDITOR" git commit &&
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit &&
commit_msg_is "new message"
'
@ -212,7 +215,7 @@ test_expect_success "hook doesn't edit commit message (editor)" '
echo "more plus" >> file &&
git add file &&
echo "more plus" > FAKE_MSG &&
GIT_EDITOR="$FAKE_EDITOR" git commit --no-verify &&
GIT_EDITOR="\"\$FAKE_EDITOR\"" git commit --no-verify &&
commit_msg_is "more plus"
'