{"thread":{"id":"13032","subject":"[PATCH 0/8] Fix git's test suite to pass when the path contains spaces","startedAt":"2008-04-09T01:29:56Z","lastAt":"2008-05-05T08:25:38Z","messageCount":60,"participants":["Bryan Donlan","Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"73905","messageId":"cover.1207702130.git.bdonlan@fushizen.net","threadId":"13032","inReplyTo":null,"subject":"[PATCH 0/8] Fix git's test suite to pass when the path contains spaces","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-09T01:29:56Z","receivedAt":"2008-04-09T01:29:56Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"This patch series fixes bugs in git and git's testsuite to allow all tests\nto pass when the working directory contains whitespace and/or shell\nmetacharacters.\n\nThe first three patches in this series fix bugs in git itself that were\nuncovered in the process of fixing the test suite. Each contains additional\ntests and/or updates to existing tests to exercise the bug in question.\n\nThe remaining patches fix bugs in the test suite itself.\n\nBryan Donlan (8):\n  git-rebase.sh: Fix --merge --abort failures when path contains\n    whitespace\n  config.c: Escape backslashes in section names properly\n  git-send-email.perl: Handle shell metacharacters in $EDITOR properly\n  test-lib.sh: Handle properly cases where the git checkout path\n    contains whitespace\n  test-lib.sh: Add a test_set_editor function to safely set $VISUAL\n  lib-git-svn.sh: Handle paths with shell metacharacters correctly\n  Use test_set_editor in t9001-send-email.sh\n  Fix tests breaking when checkout path contains shell metacharacters\n\n config.c                                      |    2 +-\n git-rebase.sh                                 |    4 +-\n git-send-email.perl                           |    2 +-\n t/lib-git-svn.sh                              |   11 +++--\n t/t0000-basic.sh                              |    4 +-\n t/t0001-init.sh                               |    2 +-\n t/t1020-subdirectory.sh                       |   24 +++++-----\n t/t1303-wacky-config.sh                       |    6 +++\n t/t1501-worktree.sh                           |   14 +++---\n t/t3050-subprojects-fetch.sh                  |    2 +-\n t/t3404-rebase-interactive.sh                 |    3 +-\n t/t3407-rebase-abort.sh                       |   55 ++++++++++++++----------\n t/t5500-fetch-pack.sh                         |    2 +-\n t/t5512-ls-remote.sh                          |    2 +-\n t/t5516-fetch-push.sh                         |    8 ++--\n t/t5700-clone-reference.sh                    |    4 +-\n t/t5710-info-alternate.sh                     |    4 +-\n t/t7003-filter-branch.sh                      |    4 +-\n t/t7010-setup.sh                              |    2 +-\n t/t7300-clean.sh                              |    2 +-\n t/t7501-commit.sh                             |    8 ++--\n t/t7504-commit-msg-hook.sh                    |   20 +++++-----\n t/t7505-prepare-commit-msg-hook.sh            |   14 +++---\n t/t9001-send-email.sh                         |    5 +-\n t/t9100-git-svn-basic.sh                      |   54 ++++++++++++------------\n t/t9101-git-svn-props.sh                      |    6 +-\n t/t9102-git-svn-deep-rmdir.sh                 |    6 +-\n t/t9103-git-svn-tracked-directory-removed.sh  |   30 +++++++-------\n t/t9104-git-svn-follow-parent.sh              |   50 +++++++++++-----------\n t/t9105-git-svn-commit-diff.sh                |   12 +++---\n t/t9106-git-svn-commit-diff-clobber.sh        |   14 +++---\n t/t9106-git-svn-dcommit-clobber-series.sh     |    6 +-\n t/t9107-git-svn-migrate.sh                    |   48 +++++++++++-----------\n t/t9108-git-svn-glob.sh                       |    8 ++--\n t/t9110-git-svn-use-svm-props.sh              |    8 ++--\n t/t9111-git-svn-use-svnsync-props.sh          |    8 ++--\n t/t9112-git-svn-md5less-file.sh               |    4 +-\n t/t9113-git-svn-dcommit-new-file.sh           |    6 +-\n t/t9114-git-svn-dcommit-merge.sh              |    4 +-\n t/t9115-git-svn-dcommit-funky-renames.sh      |    4 +-\n t/t9116-git-svn-log.sh                        |    4 +-\n t/t9117-git-svn-init-clone.sh                 |   10 ++--\n t/t9118-git-svn-funky-branch-names.sh         |   12 +++---\n t/t9120-git-svn-clone-with-percent-escapes.sh |    2 +-\n t/t9500-gitweb-standalone-no-errors.sh        |   13 +++---\n t/test-lib.sh                                 |   11 +++++-\n 46 files changed, 275 insertions(+), 249 deletions(-)\n"},{"id":"73906","messageId":"1207704604-30393-1-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"cover.1207702130.git.bdonlan@fushizen.net","subject":"[PATCH 1/8] git-rebase.sh: Fix --merge --abort failures when path contains whitespace","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-09T01:29:57Z","receivedAt":"2008-04-09T01:29:57Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"Also update t/t3407-rebase-abort.sh to exercise the bug\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n git-rebase.sh           |    4 +-\n t/t3407-rebase-abort.sh |   55 +++++++++++++++++++++++++++-------------------\n 2 files changed, 34 insertions(+), 25 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 60c458f..389b5cb 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -42,7 +42,7 @@ To restore the original branch and stop rebasing run \\\"git rebase --abort\\\".\n unset newbase\n strategy=recursive\n do_merge=\n-dotest=$GIT_DIR/.dotest-merge\n+dotest=\"$GIT_DIR/.dotest-merge\"\n prec=4\n verbose=\n git_am_opt=\n@@ -214,7 +214,7 @@ do\n \t\telse\n \t\t\tdie \"No rebase in progress?\"\n \t\tfi\n-\t\tgit reset --hard $(cat $dotest/orig-head)\n+\t\tgit reset --hard $(cat \"$dotest/orig-head\")\n \t\trm -r \"$dotest\"\n \t\texit\n \t\t;;\ndiff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh\nindex 37944c3..396a354 100755\n--- a/t/t3407-rebase-abort.sh\n+++ b/t/t3407-rebase-abort.sh\n@@ -4,7 +4,13 @@ test_description='git rebase --abort tests'\n \n . ./test-lib.sh\n \n+### Test that we handle strange characters properly\n+work_dir=\"$(pwd)/test \\\" ' \\$ \\\\ dir\"\n+\n test_expect_success setup '\n+\tmkdir -p \"$work_dir\" &&\n+\tcd \"$work_dir\" &&\n+\tgit init &&\n \techo a > a &&\n \tgit add a &&\n \tgit commit -m a &&\n@@ -27,42 +33,45 @@ testrebase() {\n \ttype=$1\n \tdotest=$2\n \n-\ttest_expect_success \"rebase$type --abort\" '\n+\ttest_expect_success \"rebase$type --abort\" \"\n+\t\tcd \\\"\\$work_dir\\\" &&\n \t\t# Clean up the state from the previous one\n-\t\tgit reset --hard pre-rebase\n-\t\ttest_must_fail git rebase'\"$type\"' master &&\n-\t\ttest -d '$dotest' &&\n+\t\tgit reset --hard pre-rebase &&\n+\t\ttest_must_fail git rebase$type master &&\n+\t\ttest -d \\\"\\$dotest\\\" &&\n \t\tgit rebase --abort &&\n-\t\ttest $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&\n-\t\ttest ! -d '$dotest'\n-\t'\n+\t\ttest \\$(git rev-parse to-rebase) = \\$(git rev-parse pre-rebase) &&\n+\t\ttest ! -d \\\"\\$dotest\\\"\n+\t\"\n \n-\ttest_expect_success \"rebase$type --abort after --skip\" '\n+\ttest_expect_success \"rebase$type --abort after --skip\" \"\n+\t\tcd \\\"\\$work_dir\\\" &&\n \t\t# Clean up the state from the previous one\n-\t\tgit reset --hard pre-rebase\n-\t\ttest_must_fail git rebase'\"$type\"' master &&\n-\t\ttest -d '$dotest' &&\n+\t\tgit reset --hard pre-rebase &&\n+\t\ttest_must_fail git rebase$type master &&\n+\t\ttest -d \\\"\\$dotest\\\" &&\n \t\ttest_must_fail git rebase --skip &&\n-\t\ttest $(git rev-parse HEAD) = $(git rev-parse master) &&\n+\t\ttest \\$(git rev-parse HEAD) = \\$(git rev-parse master) &&\n \t\tgit-rebase --abort &&\n-\t\ttest $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&\n-\t\ttest ! -d '$dotest'\n-\t'\n+\t\ttest \\$(git rev-parse to-rebase) = \\$(git rev-parse pre-rebase) &&\n+\t\ttest ! -d \\\"\\$dotest\\\"\n+\t\"\n \n-\ttest_expect_success \"rebase$type --abort after --continue\" '\n+\ttest_expect_success \"rebase$type --abort after --continue\" \"\n+\t\tcd \\\"\\$work_dir\\\" &&\n \t\t# Clean up the state from the previous one\n-\t\tgit reset --hard pre-rebase\n-\t\ttest_must_fail git rebase'\"$type\"' master &&\n-\t\ttest -d '$dotest' &&\n+\t\tgit reset --hard pre-rebase &&\n+\t\ttest_must_fail git rebase$type master &&\n+\t\ttest -d \\\"\\$dotest\\\" &&\n \t\techo c > a &&\n \t\techo d >> a &&\n \t\tgit add a &&\n \t\ttest_must_fail git rebase --continue &&\n-\t\ttest $(git rev-parse HEAD) != $(git rev-parse master) &&\n+\t\ttest \\$(git rev-parse HEAD) != \\$(git rev-parse master) &&\n \t\tgit rebase --abort &&\n-\t\ttest $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&\n-\t\ttest ! -d '$dotest'\n-\t'\n+\t\ttest \\$(git rev-parse to-rebase) = \\$(git rev-parse pre-rebase) &&\n+\t\ttest ! -d \\\"\\$dotest\\\"\n+\t\"\n }\n \n testrebase \"\" .dotest\n-- \n1.5.5.8.gbbd98\n"},{"id":"73911","messageId":"1207704604-30393-2-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207704604-30393-1-git-send-email-bdonlan@fushizen.net","subject":"[PATCH 2/8] config.c: Escape backslashes in section names properly","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-09T01:29:58Z","receivedAt":"2008-04-09T01:29:58Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n config.c                |    2 +-\n t/t1303-wacky-config.sh |    6 ++++++\n 2 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/config.c b/config.c\nindex 0624494..6c07245 100644\n--- a/config.c\n+++ b/config.c\n@@ -672,7 +672,7 @@ static int store_write_section(int fd, const char* key)\n \tif (dot) {\n \t\tstrbuf_addf(&sb, \"[%.*s \\\"\", (int)(dot - key), key);\n \t\tfor (i = dot - key + 1; i < store.baselen; i++) {\n-\t\t\tif (key[i] == '\"')\n+\t\t\tif (key[i] == '\"' || key[i] == '\\\\')\n \t\t\t\tstrbuf_addch(&sb, '\\\\');\n \t\t\tstrbuf_addch(&sb, key[i]);\n \t\t}\ndiff --git a/t/t1303-wacky-config.sh b/t/t1303-wacky-config.sh\nindex 99985dc..f366b53 100755\n--- a/t/t1303-wacky-config.sh\n+++ b/t/t1303-wacky-config.sh\n@@ -34,4 +34,10 @@ test_expect_success 'add key in different section' '\n \tcheck section2.key bar\n '\n \n+SECTION=\"test.q\\\"s\\\\sq'sp e.key\"\n+test_expect_success 'make sure git-config escapes section names properly' '\n+\tgit config \"$SECTION\" bar &&\n+\tcheck \"$SECTION\" bar\n+'\n+\n test_done\n-- \n1.5.5.8.gbbd98\n"},{"id":"73912","messageId":"1207704604-30393-3-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207704604-30393-2-git-send-email-bdonlan@fushizen.net","subject":"[PATCH 3/8] git-send-email.perl: Handle shell metacharacters in $EDITOR properly","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-09T01:29:59Z","receivedAt":"2008-04-09T01:29:59Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"Also, update t/t9001-send-email.sh to test for this bug.\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n git-send-email.perl   |    2 +-\n t/t9001-send-email.sh |    8 ++++++--\n 2 files changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex be4a20d..975df1c 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -510,7 +510,7 @@ EOT\n \tclose(C);\n \n \tmy $editor = $ENV{GIT_EDITOR} || $repo->config(\"core.editor\") || $ENV{VISUAL} || $ENV{EDITOR} || \"vi\";\n-\tsystem('sh', '-c', '$0 $@', $editor, $compose_filename);\n+\tsystem('sh', '-c', $editor.' $@', $editor, $compose_filename);\n \n \topen(C2,\">\",$compose_filename . \".final\")\n \t\tor die \"Failed to open $compose_filename.final : \" . $!;\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex c0973b4..030f66c 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -139,15 +139,19 @@ test_expect_success 'Valid In-Reply-To when prompting' '\n \n test_expect_success 'setup fake editor' '\n \t(echo \"#!/bin/sh\" &&\n-\t echo \"echo fake edit >>\\$1\"\n+\t echo \"echo fake edit >>\\\"\\$1\\\"\"\n \t) >fake-editor &&\n \tchmod +x fake-editor\n '\n \n+FAKE_EDITOR=\"$(pwd)/fake-editor\"\n+export FAKE_EDITOR\n+GIT_EDITOR='\"$FAKE_EDITOR\"'\n+export GIT_EDITOR\n+\n test_expect_success '--compose works' '\n \tclean_fake_sendmail &&\n \techo y | \\\n-\t\tGIT_EDITOR=$(pwd)/fake-editor \\\n \t\tGIT_SEND_EMAIL_NOTTY=1 \\\n \t\tgit send-email \\\n \t\t--compose --subject foo \\\n-- \n1.5.5.8.gbbd98\n"},{"id":"73909","messageId":"1207704604-30393-4-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207704604-30393-3-git-send-email-bdonlan@fushizen.net","subject":"[PATCH 4/8] test-lib.sh: Fix some missing path quoting","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-09T01:30:00Z","receivedAt":"2008-04-09T01:30:00Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/test-lib.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 7c2a8ba..17d4bc0 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -329,7 +329,7 @@ test_create_repo () {\n \trepo=\"$1\"\n \tmkdir \"$repo\"\n \tcd \"$repo\" || error \"Cannot setup test environment\"\n-\t\"$GIT_EXEC_PATH/git\" init --template=$GIT_EXEC_PATH/templates/blt/ >/dev/null 2>&1 ||\n+\t\"$GIT_EXEC_PATH/git\" init \"--template=$GIT_EXEC_PATH/templates/blt/\" >/dev/null 2>&1 ||\n \terror \"cannot run git init -- have you built things yet?\"\n \tmv .git/hooks .git/hooks-disabled\n \tcd \"$owd\"\n-- \n1.5.5.8.gbbd98\n"},{"id":"73908","messageId":"1207704604-30393-5-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207704604-30393-4-git-send-email-bdonlan@fushizen.net","subject":"[PATCH 5/8] test-lib.sh: Add a test_set_editor function to safely set $VISUAL","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-09T01:30:01Z","receivedAt":"2008-04-09T01:30:01Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"In particular, this function correctly handles cases where the pwd contains\nspaces, quotes, and other troublesome metacharacters.\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/test-lib.sh |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 17d4bc0..6f43376 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -160,6 +160,15 @@ die () {\n \n trap 'die' exit\n \n+test_set_editor () {\n+\t# If the editor path contains a quote, just using VISUAL='\"path\"' isn't\n+\t# enough.\n+\tFAKE_EDITOR=\"$1\"\n+\texport FAKE_EDITOR\n+\tVISUAL='\"$FAKE_EDITOR\"'\n+\texport VISUAL\n+}\n+\n test_tick () {\n \tif test -z \"${test_tick+set}\"\n \tthen\n-- \n1.5.5.8.gbbd98\n"},{"id":"73910","messageId":"1207704604-30393-6-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207704604-30393-5-git-send-email-bdonlan@fushizen.net","subject":"[PATCH 6/8] lib-git-svn.sh: Fix quoting issues with paths containing shell metacharacters","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-09T01:30:02Z","receivedAt":"2008-04-09T01:30:02Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/lib-git-svn.sh |   11 ++++++-----\n 1 files changed, 6 insertions(+), 5 deletions(-)\n\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex 9decd2e..1b37ba8 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -7,9 +7,9 @@ then\n \texit\n fi\n \n-GIT_DIR=$PWD/.git\n-GIT_SVN_DIR=$GIT_DIR/svn/git-svn\n-SVN_TREE=$GIT_SVN_DIR/svn-tree\n+GIT_DIR=\"$PWD/.git\"\n+GIT_SVN_DIR=\"$GIT_DIR/svn/git-svn\"\n+SVN_TREE=\"$GIT_SVN_DIR/svn-tree\"\n \n svn >/dev/null 2>&1\n if test $? -ne 1\n@@ -19,13 +19,14 @@ then\n     exit\n fi\n \n-svnrepo=$PWD/svnrepo\n+svnrepo=\"$PWD/svnrepo\"\n+export svnrepo\n \n perl -w -e \"\n use SVN::Core;\n use SVN::Repos;\n \\$SVN::Core::VERSION gt '1.1.0' or exit(42);\n-system(qw/svnadmin create --fs-type fsfs/, '$svnrepo') == 0 or exit(41);\n+system(qw/svnadmin create --fs-type fsfs/, \\$ENV{svnrepo}) == 0 or exit(41);\n \" >&3 2>&4\n x=$?\n if test $x -ne 0\n-- \n1.5.5.8.gbbd98\n"},{"id":"73913","messageId":"1207704604-30393-7-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207704604-30393-6-git-send-email-bdonlan@fushizen.net","subject":"[PATCH 7/8] Use test_set_editor in t9001-send-email.sh","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-09T01:30:03Z","receivedAt":"2008-04-09T01:30:03Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/t9001-send-email.sh |    5 +----\n 1 files changed, 1 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex 030f66c..0a65785 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -144,10 +144,7 @@ test_expect_success 'setup fake editor' '\n \tchmod +x fake-editor\n '\n \n-FAKE_EDITOR=\"$(pwd)/fake-editor\"\n-export FAKE_EDITOR\n-GIT_EDITOR='\"$FAKE_EDITOR\"'\n-export GIT_EDITOR\n+test_set_editor \"$(pwd)/fake-editor\"\n \n test_expect_success '--compose works' '\n \tclean_fake_sendmail &&\n-- \n1.5.5.8.gbbd98\n"},{"id":"73907","messageId":"1207704604-30393-8-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207704604-30393-7-git-send-email-bdonlan@fushizen.net","subject":"[PATCH 8/8] Fix tests breaking when checkout path contains shell metacharacters","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-09T01:30:04Z","receivedAt":"2008-04-09T01:30:04Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"This fixes the remainder of the issues where the test script itself is at\nfault for failing when the git checkout path contains whitespace or other\nshell metacharacters.\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/t0000-basic.sh                              |    4 +-\n t/t0001-init.sh                               |    2 +-\n t/t1020-subdirectory.sh                       |   24 +++++-----\n t/t1501-worktree.sh                           |   14 +++---\n t/t3050-subprojects-fetch.sh                  |    2 +-\n t/t3404-rebase-interactive.sh                 |    3 +-\n t/t5500-fetch-pack.sh                         |    2 +-\n t/t5512-ls-remote.sh                          |    2 +-\n t/t5516-fetch-push.sh                         |    8 ++--\n t/t5700-clone-reference.sh                    |    4 +-\n t/t5710-info-alternate.sh                     |    4 +-\n t/t7003-filter-branch.sh                      |    4 +-\n t/t7010-setup.sh                              |    2 +-\n t/t7300-clean.sh                              |    2 +-\n t/t7501-commit.sh                             |    8 ++--\n t/t7504-commit-msg-hook.sh                    |   20 +++++-----\n t/t7505-prepare-commit-msg-hook.sh            |   14 +++---\n t/t9100-git-svn-basic.sh                      |   54 ++++++++++++------------\n t/t9101-git-svn-props.sh                      |    6 +-\n t/t9102-git-svn-deep-rmdir.sh                 |    6 +-\n t/t9103-git-svn-tracked-directory-removed.sh  |   30 +++++++-------\n t/t9104-git-svn-follow-parent.sh              |   50 +++++++++++-----------\n t/t9105-git-svn-commit-diff.sh                |   12 +++---\n t/t9106-git-svn-commit-diff-clobber.sh        |   14 +++---\n t/t9106-git-svn-dcommit-clobber-series.sh     |    6 +-\n t/t9107-git-svn-migrate.sh                    |   48 +++++++++++-----------\n t/t9108-git-svn-glob.sh                       |    8 ++--\n t/t9110-git-svn-use-svm-props.sh              |    8 ++--\n t/t9111-git-svn-use-svnsync-props.sh          |    8 ++--\n t/t9112-git-svn-md5less-file.sh               |    4 +-\n t/t9113-git-svn-dcommit-new-file.sh           |    6 +-\n t/t9114-git-svn-dcommit-merge.sh              |    4 +-\n t/t9115-git-svn-dcommit-funky-renames.sh      |    4 +-\n t/t9116-git-svn-log.sh                        |    4 +-\n t/t9117-git-svn-init-clone.sh                 |   10 ++--\n t/t9118-git-svn-funky-branch-names.sh         |   12 +++---\n t/t9120-git-svn-clone-with-percent-escapes.sh |    2 +-\n t/t9500-gitweb-standalone-no-errors.sh        |   13 +++---\n 38 files changed, 214 insertions(+), 214 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex 27b54cb..690f80a 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -305,10 +305,10 @@ test_expect_success 'absolute path works as expected' '\n \tfile=\"$dir\"/index &&\n \ttest \"$file\" = \"$(test-absolute-path $dir2/index)\" &&\n \tbasename=blub &&\n-\ttest \"$dir/$basename\" = $(cd .git && test-absolute-path $basename) &&\n+\ttest \"$dir/$basename\" = \"$(cd .git && test-absolute-path \"$basename\")\" &&\n \tln -s ../first/file .git/syml &&\n \tsym=\"$(cd first; pwd -P)\"/file &&\n-\ttest \"$sym\" = \"$(test-absolute-path $dir2/syml)\"\n+\ttest \"$sym\" = \"$(test-absolute-path \"$dir2/syml\")\"\n '\n \n test_expect_success 'very long name in the index handled sanely' '\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex b0289e3..22eb735 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -95,7 +95,7 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (1)' '\n \t(\n \t\tunset GIT_CONFIG\n \t\tmkdir git-dir-wt-1.git &&\n-\t\tGIT_WORK_TREE=$(pwd) GIT_DIR=git-dir-wt-1.git git init\n+\t\tGIT_WORK_TREE=\"$(pwd)\" GIT_DIR=git-dir-wt-1.git git init\n \t) &&\n \tcheck_config git-dir-wt-1.git false \"$(pwd)\"\n '\ndiff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh\nindex b9cef34..20a1e82 100755\n--- a/t/t1020-subdirectory.sh\n+++ b/t/t1020-subdirectory.sh\n@@ -16,12 +16,12 @@ test_expect_success setup '\n \tcp one original.one &&\n \tcp dir/two original.two\n '\n-HERE=`pwd`\n+HERE=\"$(pwd)\"\n LF='\n '\n \n test_expect_success 'update-index and ls-files' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit update-index --add one &&\n \tcase \"`git ls-files`\" in\n \tone) echo ok one ;;\n@@ -41,7 +41,7 @@ test_expect_success 'update-index and ls-files' '\n '\n \n test_expect_success 'cat-file' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \ttwo=`git ls-files -s dir/two` &&\n \ttwo=`expr \"$two\" : \"[0-7]* \\\\([0-9a-f]*\\\\)\"` &&\n \techo \"$two\" &&\n@@ -54,7 +54,7 @@ test_expect_success 'cat-file' '\n rm -f actual dir/actual\n \n test_expect_success 'diff-files' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \techo a >>one &&\n \techo d >>dir/two &&\n \tcase \"`git diff-files --name-only`\" in\n@@ -74,7 +74,7 @@ test_expect_success 'diff-files' '\n '\n \n test_expect_success 'write-tree' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \ttop=`git write-tree` &&\n \techo $top &&\n \tcd dir &&\n@@ -84,7 +84,7 @@ test_expect_success 'write-tree' '\n '\n \n test_expect_success 'checkout-index' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit checkout-index -f -u one &&\n \tcmp one original.one &&\n \tcd dir &&\n@@ -93,7 +93,7 @@ test_expect_success 'checkout-index' '\n '\n \n test_expect_success 'read-tree' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \trm -f one dir/two &&\n \ttree=`git write-tree` &&\n \tgit read-tree --reset -u \"$tree\" &&\n@@ -107,27 +107,27 @@ test_expect_success 'read-tree' '\n '\n \n test_expect_success 'no file/rev ambiguity check inside .git' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit commit -a -m 1 &&\n-\tcd $HERE/.git &&\n+\tcd \"$HERE\"/.git &&\n \tgit show -s HEAD\n '\n \n test_expect_success 'no file/rev ambiguity check inside a bare repo' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit clone -s --bare .git foo.git &&\n \tcd foo.git && GIT_DIR=. git show -s HEAD\n '\n \n # This still does not work as it should...\n : test_expect_success 'no file/rev ambiguity check inside a bare repo' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit clone -s --bare .git foo.git &&\n \tcd foo.git && git show -s HEAD\n '\n \n test_expect_success 'detection should not be fooled by a symlink' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \trm -fr foo.git &&\n \tgit clone -s .git another &&\n \tln -s another yetanother &&\ndiff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh\nindex 7ee3820..ffb77b6 100755\n--- a/t/t1501-worktree.sh\n+++ b/t/t1501-worktree.sh\n@@ -48,8 +48,8 @@ test_rev_parse 'subdirectory' false false true sub/dir/\n cd ../../.. || exit 1\n \n say \"core.worktree = absolute path\"\n-export GIT_DIR=$(pwd)/repo.git\n-export GIT_CONFIG=$GIT_DIR/config\n+export GIT_DIR=\"$(pwd)/repo.git\"\n+export GIT_CONFIG=\"$GIT_DIR/config\"\n git config core.worktree \"$(pwd)/work\"\n test_rev_parse 'outside'      false false false\n cd work || exit 1\n@@ -59,8 +59,8 @@ test_rev_parse 'subdirectory' false false true sub/dir/\n cd ../../.. || exit 1\n \n say \"GIT_WORK_TREE=relative path (override core.worktree)\"\n-export GIT_DIR=$(pwd)/repo.git\n-export GIT_CONFIG=$GIT_DIR/config\n+export GIT_DIR=\"$(pwd)/repo.git\"\n+export GIT_CONFIG=\"$GIT_DIR/config\"\n git config core.worktree non-existent\n export GIT_WORK_TREE=work\n test_rev_parse 'outside'      false false false\n@@ -75,9 +75,9 @@ cd ../../.. || exit 1\n mv work repo.git/work\n \n say \"GIT_WORK_TREE=absolute path, work tree below git dir\"\n-export GIT_DIR=$(pwd)/repo.git\n-export GIT_CONFIG=$GIT_DIR/config\n-export GIT_WORK_TREE=$(pwd)/repo.git/work\n+export GIT_DIR=\"$(pwd)/repo.git\"\n+export GIT_CONFIG=\"$GIT_DIR/config\"\n+export GIT_WORK_TREE=\"$(pwd)/repo.git/work\"\n test_rev_parse 'outside'              false false false\n cd repo.git || exit 1\n test_rev_parse 'in repo.git'              false true  false\ndiff --git a/t/t3050-subprojects-fetch.sh b/t/t3050-subprojects-fetch.sh\nindex 2b21b10..4261e96 100755\n--- a/t/t3050-subprojects-fetch.sh\n+++ b/t/t3050-subprojects-fetch.sh\n@@ -20,7 +20,7 @@ test_expect_success setup '\n '\n \n test_expect_success clone '\n-\tgit clone file://`pwd`/.git cloned &&\n+\tgit clone \"file://$(pwd)/.git\" cloned &&\n \t(git rev-parse HEAD; git ls-files -s) >expected &&\n \t(\n \t\tcd cloned &&\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 9cf873f..b9e3dbd 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -91,9 +91,8 @@ for line in $FAKE_LINES; do\n done\n EOF\n \n+test_set_editor \"$(pwd)/fake-editor.sh\"\n chmod a+x fake-editor.sh\n-VISUAL=\"$(pwd)/fake-editor.sh\"\n-export VISUAL\n \n test_expect_success 'no changes are a nop' '\n \tgit rebase -i F &&\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 788b4a5..c52707b 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -129,7 +129,7 @@ pull_to_client 2nd \"B\" $((64*3))\n \n pull_to_client 3rd \"A\" $((1*3)) # old fails\n \n-test_expect_success \"clone shallow\" \"git-clone --depth 2 file://`pwd`/. shallow\"\n+test_expect_success \"clone shallow\" 'git-clone --depth 2 \"file://$(pwd)/.\" shallow'\n \n (cd shallow; git count-objects -v) > count.shallow\n \ndiff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh\nindex c0dc949..1dd8eed 100755\n--- a/t/t5512-ls-remote.sh\n+++ b/t/t5512-ls-remote.sh\n@@ -17,7 +17,7 @@ test_expect_success setup '\n \t\tgit show-ref -d\t| sed -e \"s/ /\t/\"\n \t) >expected.all &&\n \n-\tgit remote add self $(pwd)/.git\n+\tgit remote add self \"$(pwd)/.git\"\n \n '\n \ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex 793ffc6..6e8cb9e 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -103,9 +103,9 @@ test_expect_success 'fetch with wildcard' '\n test_expect_success 'fetch with insteadOf' '\n \tmk_empty &&\n \t(\n-\t\tTRASH=$(pwd) &&\n+\t\tTRASH=\"$(pwd)\" &&\n \t\tcd testrepo &&\n-\t\tgit config url./$TRASH/.insteadOf trash/\n+\t\tgit config \"url./$TRASH/.insteadOf\" trash/ &&\n \t\tgit config remote.up.url trash/. &&\n \t\tgit config remote.up.fetch \"refs/heads/*:refs/remotes/origin/*\" &&\n \t\tgit fetch up &&\n@@ -145,8 +145,8 @@ test_expect_success 'push with wildcard' '\n \n test_expect_success 'push with insteadOf' '\n \tmk_empty &&\n-\tTRASH=$(pwd) &&\n-\tgit config url./$TRASH/.insteadOf trash/ &&\n+\tTRASH=\"$(pwd)\" &&\n+\tgit config \"url./$TRASH/.insteadOf\" trash/ &&\n \tgit push trash/testrepo refs/heads/master:refs/remotes/origin/master &&\n \t(\n \t\tcd testrepo &&\ndiff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh\nindex b6a5486..82ef023 100755\n--- a/t/t5700-clone-reference.sh\n+++ b/t/t5700-clone-reference.sh\n@@ -6,7 +6,7 @@\n test_description='test clone --reference'\n . ./test-lib.sh\n \n-base_dir=`pwd`\n+base_dir=\"$(pwd)\"\n \n test_expect_success 'preparing first repository' \\\n 'test_create_repo A && cd A &&\n@@ -51,7 +51,7 @@ diff expected current'\n cd \"$base_dir\"\n \n test_expect_success 'cloning with reference (no -l -s)' \\\n-'git clone --reference B file://`pwd`/A D'\n+'git clone --reference B \"file://$(pwd)/A\" D'\n \n cd \"$base_dir\"\n \ndiff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh\nindex 910ccb4..8f26999 100755\n--- a/t/t5710-info-alternate.sh\n+++ b/t/t5710-info-alternate.sh\n@@ -21,7 +21,7 @@ test_valid_repo() {\n \ttest `wc -l < fsck.log` = 0\n }\n \n-base_dir=`pwd`\n+base_dir=\"$(pwd)\"\n \n test_expect_success 'preparing first repository' \\\n 'test_create_repo A && cd A &&\n@@ -81,7 +81,7 @@ test_valid_repo'\n cd \"$base_dir\"\n \n test_expect_success 'breaking of loops' \\\n-\"echo '$base_dir/B/.git/objects' >> '$base_dir'/A/.git/objects/info/alternates&&\n+\"echo \\\"\\$base_dir\\\"/B/.git/objects >> \\\"\\$base_dir\\\"/A/.git/objects/info/alternates&&\n cd C &&\n test_valid_repo\"\n \ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex efd658a..abe3d83 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -123,9 +123,9 @@ test_expect_success 'use index-filter to move into a subdirectory' '\n \tgit branch directorymoved &&\n \tgit-filter-branch -f --index-filter \\\n \t\t \"git ls-files -s | sed \\\"s-\\\\t-&newsubdir/-\\\" |\n-\t          GIT_INDEX_FILE=\\$GIT_INDEX_FILE.new \\\n+\t          GIT_INDEX_FILE=\\\"\\$GIT_INDEX_FILE.new\\\" \\\n \t\t\tgit update-index --index-info &&\n-\t\t  mv \\$GIT_INDEX_FILE.new \\$GIT_INDEX_FILE\" directorymoved &&\n+\t\t  mv \\\"\\$GIT_INDEX_FILE.new\\\" \\\"\\$GIT_INDEX_FILE\\\"\" directorymoved &&\n \ttest -z \"$(git diff HEAD directorymoved:newsubdir)\"'\n \n test_expect_success 'stops when msg filter fails' '\ndiff --git a/t/t7010-setup.sh b/t/t7010-setup.sh\nindex 02cf7c5..d8a7c79 100755\n--- a/t/t7010-setup.sh\n+++ b/t/t7010-setup.sh\n@@ -122,7 +122,7 @@ test_expect_success 'commit using absolute path names' '\n \n test_expect_success 'log using absolute path names' '\n \techo bb >>a/b/c/d &&\n-\tgit commit -m \"bb\" $(pwd)/a/b/c/d &&\n+\tgit commit -m \"bb\" \"$(pwd)/a/b/c/d\" &&\n \n \tgit log a/b/c/d >f1.txt &&\n \tgit log \"$(pwd)/a/b/c/d\" >f2.txt &&\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nindex afccfc9..54b1352 100755\n--- a/t/t7300-clean.sh\n+++ b/t/t7300-clean.sh\n@@ -111,7 +111,7 @@ test_expect_success 'git-clean with absolute path' '\n \ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n \twould_clean=$(\n \t\tcd docs &&\n-\t\tgit clean -n $(pwd)/../src |\n+\t\tgit clean -n \"$(pwd)/../src\" |\n \t\tsed -n -e \"s|^Would remove ||p\"\n \t) &&\n \ttest \"$would_clean\" = ../src/part3.c || {\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex c0288f3..e5fdb63 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -79,8 +79,8 @@ test_expect_success \\\n \n cat >editor <<\\EOF\n #!/bin/sh\n-sed -e \"s/a file/an amend commit/g\" < $1 > $1-\n-mv $1- $1\n+sed -e \"s/a file/an amend commit/g\" < \"$1\" > \"$1-\"\n+mv \"$1-\" \"$1\"\n EOF\n chmod 755 editor\n \n@@ -99,8 +99,8 @@ test_expect_success \\\n \n cat >editor <<\\EOF\n #!/bin/sh\n-sed -e \"s/amend/older/g\"  < $1 > $1-\n-mv $1- $1\n+sed -e \"s/amend/older/g\"  < \"$1\" > \"$1-\"\n+mv \"$1-\" \"$1\"\n EOF\n chmod 755 editor\n \ndiff --git a/t/t7504-commit-msg-hook.sh b/t/t7504-commit-msg-hook.sh\nindex eff36aa..24f6b2e 100755\n--- a/t/t7504-commit-msg-hook.sh\n+++ b/t/t7504-commit-msg-hook.sh\n@@ -27,7 +27,7 @@ test_expect_success 'with no hook (editor)' '\n \techo \"more foo\" >> file &&\n \tgit add file &&\n \techo \"more foo\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit\n \n '\n \n@@ -44,7 +44,7 @@ test_expect_success '--no-verify with no hook (editor)' '\n \techo \"more bar\" > file &&\n \tgit add file &&\n \techo \"more bar\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify\n \n '\n \n@@ -71,7 +71,7 @@ test_expect_success 'with succeeding hook (editor)' '\n \techo \"more more\" >> file &&\n \tgit add file &&\n \techo \"more more\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit\n \n '\n \n@@ -88,7 +88,7 @@ test_expect_success '--no-verify with succeeding hook (editor)' '\n \techo \"even more more\" >> file &&\n \tgit add file &&\n \techo \"even more more\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify\n \n '\n \n@@ -111,7 +111,7 @@ test_expect_success 'with failing hook (editor)' '\n \techo \"more another\" >> file &&\n \tgit add file &&\n \techo \"more another\" > FAKE_MSG &&\n-\t! (GIT_EDITOR=\"$FAKE_EDITOR\" git commit)\n+\t! (GIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit)\n \n '\n \n@@ -128,7 +128,7 @@ test_expect_success '--no-verify with failing hook (editor)' '\n \techo \"more stuff\" >> file &&\n \tgit add file &&\n \techo \"more stuff\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify\n \n '\n \n@@ -146,7 +146,7 @@ test_expect_success 'with non-executable hook (editor)' '\n \techo \"content again\" >> file &&\n \tgit add file &&\n \techo \"content again\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit -m \"content again\"\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -m \"content again\"\n \n '\n \n@@ -163,7 +163,7 @@ test_expect_success '--no-verify with non-executable hook (editor)' '\n \techo \"even more content\" >> file &&\n \tgit add file &&\n \techo \"even more content\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify\n \n '\n \n@@ -193,7 +193,7 @@ test_expect_success 'hook edits commit message (editor)' '\n \techo \"additional content\" >> file &&\n \tgit add file &&\n \techo \"additional content\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit &&\n \tcommit_msg_is \"new message\"\n \n '\n@@ -212,7 +212,7 @@ test_expect_success \"hook doesn't edit commit message (editor)\" '\n \techo \"more plus\" >> file &&\n \tgit add file &&\n \techo \"more plus\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify &&\n \tcommit_msg_is \"more plus\"\n \n '\ndiff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh\nindex 802aa62..bc2bad9 100755\n--- a/t/t7505-prepare-commit-msg-hook.sh\n+++ b/t/t7505-prepare-commit-msg-hook.sh\n@@ -58,7 +58,7 @@ test_expect_success 'with hook (-m editor)' '\n \n \techo \"more\" >> file &&\n \tgit add file &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit -e -m \"more more\" &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -e -m \"more more\" &&\n \ttest \"`git log -1 --pretty=format:%s`\" = message\n \n '\n@@ -85,7 +85,7 @@ test_expect_success 'with hook (-F editor)' '\n \n \techo \"more\" >> file &&\n \tgit add file &&\n-\t(echo more more | GIT_EDITOR=\"$FAKE_EDITOR\" git commit -e -F -) &&\n+\t(echo more more | GIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -e -F -) &&\n \ttest \"`git log -1 --pretty=format:%s`\" = message\n \n '\n@@ -104,7 +104,7 @@ test_expect_success 'with hook (editor)' '\n \n \techo \"more more\" >> file &&\n \tgit add file &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit &&\n \ttest \"`git log -1 --pretty=format:%s`\" = default\n \n '\n@@ -114,7 +114,7 @@ test_expect_success 'with hook (--amend)' '\n \thead=`git rev-parse HEAD` &&\n \techo \"more\" >> file &&\n \tgit add file &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --amend &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --amend &&\n \ttest \"`git log -1 --pretty=format:%s`\" = \"$head\"\n \n '\n@@ -124,7 +124,7 @@ test_expect_success 'with hook (-c)' '\n \thead=`git rev-parse HEAD` &&\n \techo \"more\" >> file &&\n \tgit add file &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit -c $head &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -c $head &&\n \ttest \"`git log -1 --pretty=format:%s`\" = \"$head\"\n \n '\n@@ -139,7 +139,7 @@ test_expect_success 'with failing hook' '\n \thead=`git rev-parse HEAD` &&\n \techo \"more\" >> file &&\n \tgit add file &&\n-\t! GIT_EDITOR=\"$FAKE_EDITOR\" git commit -c $head\n+\t! GIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -c $head\n \n '\n \n@@ -148,7 +148,7 @@ test_expect_success 'with failing hook (--no-verify)' '\n \thead=`git rev-parse HEAD` &&\n \techo \"more\" >> file &&\n \tgit add file &&\n-\t! GIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify -c $head\n+\t! GIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify -c $head\n \n '\n \ndiff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh\nindex 4e24ab3..528c0a9 100755\n--- a/t/t9100-git-svn-basic.sh\n+++ b/t/t9100-git-svn-basic.sh\n@@ -31,16 +31,16 @@ test_expect_success \\\n \techo 'zzz' > bar/zzz &&\n \techo '#!/bin/sh' > exec.sh &&\n \tchmod +x exec.sh &&\n-\tsvn import -m 'import for git-svn' . $svnrepo >/dev/null &&\n+\tsvn import -m 'import for git-svn' . \\\"\\$svnrepo\\\" >/dev/null &&\n \tcd .. &&\n \trm -rf import &&\n-\tgit-svn init $svnrepo\"\n+\tgit-svn init \\\"\\$svnrepo\\\"\"\n \n test_expect_success \\\n     'import an SVN revision into git' \\\n     'git-svn fetch'\n \n-test_expect_success \"checkout from svn\" \"svn co $svnrepo '$SVN_TREE'\"\n+test_expect_success \"checkout from svn\" \"svn co \\\"\\$svnrepo\\\" \\\"\\$SVN_TREE\\\"\"\n \n name='try a deep --rmdir with a commit'\n test_expect_success \"$name\" \"\n@@ -51,8 +51,8 @@ test_expect_success \"$name\" \"\n \tgit commit -m '$name' &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -d '$SVN_TREE'/dir && test ! -d '$SVN_TREE'/dir/a\"\n+\tsvn up \\\"\\$SVN_TREE\\\" &&\n+\ttest -d \\\"\\$SVN_TREE\\\"/dir && test ! -d \\\"\\$SVN_TREE\\\"/dir/a\"\n \n \n name='detect node change from file to directory #1'\n@@ -69,7 +69,7 @@ test_expect_success \"$name\" \"\n \n name='detect node change from directory to file #1'\n test_expect_success \"$name\" \"\n-\trm -rf dir '$GIT_DIR'/index &&\n+\trm -rf dir \\\"\\$GIT_DIR\\\"/index &&\n \tgit checkout -f -b mybranch2 remotes/git-svn &&\n \tmv bar/zzz zzz &&\n \trm -rf bar &&\n@@ -83,7 +83,7 @@ test_expect_success \"$name\" \"\n \n name='detect node change from file to directory #2'\n test_expect_success \"$name\" \"\n-\trm -f '$GIT_DIR'/index &&\n+\trm -f \\\"\\$GIT_DIR\\\"/index &&\n \tgit checkout -f -b mybranch3 remotes/git-svn &&\n \trm bar/zzz &&\n \tgit update-index --remove bar/zzz &&\n@@ -97,7 +97,7 @@ test_expect_success \"$name\" \"\n \n name='detect node change from directory to file #2'\n test_expect_success \"$name\" \"\n-\trm -f '$GIT_DIR'/index &&\n+\trm -f \\\"\\$GIT_DIR\\\"/index &&\n \tgit checkout -f -b mybranch4 remotes/git-svn &&\n \trm -rf dir &&\n \tgit update-index --remove -- dir/file &&\n@@ -111,15 +111,15 @@ test_expect_success \"$name\" \"\n \n name='remove executable bit from a file'\n test_expect_success \"$name\" \"\n-\trm -f '$GIT_DIR'/index &&\n+\trm -f \\\"\\$GIT_DIR\\\"/index &&\n \tgit checkout -f -b mybranch5 remotes/git-svn &&\n \tchmod -x exec.sh &&\n \tgit update-index exec.sh &&\n \tgit commit -m '$name' &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest ! -x '$SVN_TREE'/exec.sh\"\n+\tsvn up \\\"\\$SVN_TREE\\\" &&\n+\ttest ! -x \\\"\\$SVN_TREE\\\"/exec.sh\"\n \n \n name='add executable bit back file'\n@@ -129,8 +129,8 @@ test_expect_success \"$name\" \"\n \tgit commit -m '$name' &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -x '$SVN_TREE'/exec.sh\"\n+\tsvn up \\\"\\$SVN_TREE\\\" &&\n+\ttest -x \\\"\\$SVN_TREE\\\"/exec.sh\"\n \n \n name='executable file becomes a symlink to bar/zzz (file)'\n@@ -141,8 +141,8 @@ test_expect_success \"$name\" \"\n \tgit commit -m '$name' &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -L '$SVN_TREE'/exec.sh\"\n+\tsvn up \\\"\\$SVN_TREE\\\" &&\n+\ttest -L \\\"\\$SVN_TREE\\\"/exec.sh\"\n \n name='new symlink is added to a file that was also just made executable'\n \n@@ -153,9 +153,9 @@ test_expect_success \"$name\" \"\n \tgit commit -m '$name' &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -x '$SVN_TREE'/bar/zzz &&\n-\ttest -L '$SVN_TREE'/exec-2.sh\"\n+\tsvn up \\\"\\$SVN_TREE\\\" &&\n+\ttest -x \\\"\\$SVN_TREE\\\"/bar/zzz &&\n+\ttest -L \\\"\\$SVN_TREE\\\"/exec-2.sh\"\n \n name='modify a symlink to become a file'\n test_expect_success \"$name\" \"\n@@ -166,10 +166,10 @@ test_expect_success \"$name\" \"\n \tgit commit -m '$name' &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -f '$SVN_TREE'/exec-2.sh &&\n-\ttest ! -L '$SVN_TREE'/exec-2.sh &&\n-\tgit diff help $SVN_TREE/exec-2.sh\"\n+\tsvn up \\\"\\$SVN_TREE\\\" &&\n+\ttest -f \\\"\\$SVN_TREE\\\"/exec-2.sh &&\n+\ttest ! -L \\\"\\$SVN_TREE\\\"/exec-2.sh &&\n+\tgit diff help \\\"\\$SVN_TREE\\\"/exec-2.sh\"\n \n if test \"$have_utf8\" = t\n then\n@@ -190,7 +190,7 @@ name='test fetch functionality (svn => git) with alternate GIT_SVN_ID'\n GIT_SVN_ID=alt\n export GIT_SVN_ID\n test_expect_success \"$name\" \\\n-    \"git-svn init $svnrepo && git-svn fetch &&\n+    \"git-svn init \\\"\\$svnrepo\\\" && git-svn fetch &&\n      git rev-list --pretty=raw remotes/git-svn | grep ^tree | uniq > a &&\n      git rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&\n      git diff a b\"\n@@ -220,16 +220,16 @@ test_expect_success 'exit if remote refs are ambigious' \"\n \"\n \n test_expect_success 'exit if init-ing a would clobber a URL' \"\n-        svnadmin create ${PWD}/svnrepo2 &&\n-        svn mkdir -m 'mkdir bar' ${svnrepo}2/bar &&\n+        svnadmin create \\\"\\${PWD}/svnrepo2\\\" &&\n+        svn mkdir -m 'mkdir bar' \\\"\\${svnrepo}2/bar\\\" &&\n         git config --unset svn-remote.svn.fetch \\\n                                 '^bar:refs/remotes/git-svn$' &&\n-\t! git-svn init ${svnrepo}2/bar\n+\t! git-svn init \\\"\\${svnrepo}2/bar\\\"\n         \"\n \n test_expect_success \\\n   'init allows us to connect to another directory in the same repo' \"\n-        git-svn init --minimize-url -i bar $svnrepo/bar &&\n+        git-svn init --minimize-url -i bar \\\"\\$svnrepo/bar\\\" &&\n         git config --get svn-remote.svn.fetch \\\n                               '^bar:refs/remotes/bar$' &&\n         git config --get svn-remote.svn.fetch \\\ndiff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\nindex d7a7047..fa8b7ee 100755\n--- a/t/t9101-git-svn-props.sh\n+++ b/t/t9101-git-svn-props.sh\n@@ -52,7 +52,7 @@ EOF\n cd ..\n \n rm -rf import\n-test_expect_success 'checkout working copy from svn' \"svn co $svnrepo test_wc\"\n+test_expect_success 'checkout working copy from svn' \"svn co \\\"\\$svnrepo\\\" test_wc\"\n test_expect_success 'setup some commits to svn' \\\n \t'cd test_wc &&\n \t\techo Greetings >> kw.c &&\n@@ -66,7 +66,7 @@ test_expect_success 'setup some commits to svn' \\\n \t\tsvn commit -m \"Propset Id\" &&\n \tcd ..'\n \n-test_expect_success 'initialize git-svn' \"git-svn init $svnrepo\"\n+test_expect_success 'initialize git-svn' \"git-svn init \\\"\\$svnrepo\\\"\"\n test_expect_success 'fetch revisions from svn' 'git-svn fetch'\n \n name='test svn:keywords ignoring'\n@@ -92,7 +92,7 @@ test_expect_success \"propset CR on crlf files\" \\\n test_expect_success 'fetch and pull latest from svn and checkout a new wc' \\\n \t\"git-svn fetch &&\n \t git pull . remotes/git-svn &&\n-\t svn co $svnrepo new_wc\"\n+\t svn co \\\"\\$svnrepo\\\" new_wc\"\n \n for i in crlf ne_crlf lf ne_lf cr ne_cr empty_cr empty_lf empty empty_crlf\n do\ndiff --git a/t/t9102-git-svn-deep-rmdir.sh b/t/t9102-git-svn-deep-rmdir.sh\nindex 4e08083..8eaf7d3 100755\n--- a/t/t9102-git-svn-deep-rmdir.sh\n+++ b/t/t9102-git-svn-deep-rmdir.sh\n@@ -9,12 +9,12 @@ test_expect_success 'initialize repo' \"\n \tmkdir -p deeply/nested/directory/number/2 &&\n \techo foo > deeply/nested/directory/number/1/file &&\n \techo foo > deeply/nested/directory/number/2/another &&\n-\tsvn import -m 'import for git-svn' . $svnrepo &&\n+\tsvn import -m 'import for git-svn' . \\\"\\$svnrepo\\\" &&\n \tcd ..\n \t\"\n \n test_expect_success 'mirror via git-svn' \"\n-\tgit-svn init $svnrepo &&\n+\tgit-svn init \\\"\\$svnrepo\\\" &&\n \tgit-svn fetch &&\n \tgit checkout -f -b test-rmdir remotes/git-svn\n \t\"\n@@ -23,7 +23,7 @@ test_expect_success 'Try a commit on rmdir' \"\n \tgit rm -f deeply/nested/directory/number/2/another &&\n \tgit commit -a -m 'remove another' &&\n \tgit-svn set-tree --rmdir HEAD &&\n-\tsvn ls -R $svnrepo | grep ^deeply/nested/directory/number/1\n+\tsvn ls -R \\\"\\$svnrepo\\\" | grep ^deeply/nested/directory/number/1\n \t\"\n \n \ndiff --git a/t/t9103-git-svn-tracked-directory-removed.sh b/t/t9103-git-svn-tracked-directory-removed.sh\nindex 0f0b0fd..c7734e6 100755\n--- a/t/t9103-git-svn-tracked-directory-removed.sh\n+++ b/t/t9103-git-svn-tracked-directory-removed.sh\n@@ -6,34 +6,34 @@\n test_description='git-svn tracking removed top-level path'\n . ./lib-git-svn.sh\n \n-test_expect_success 'make history for tracking' '\n+test_expect_success 'make history for tracking' \"\n \tmkdir import &&\n \tmkdir import/trunk &&\n \techo hello >> import/trunk/README &&\n-\tsvn import -m initial import $svnrepo &&\n+\tsvn import -m initial import \\\"\\$svnrepo\\\" &&\n \trm -rf import &&\n-\tsvn co $svnrepo/trunk trunk &&\n+\tsvn co \\\"\\$svnrepo\\\"/trunk trunk &&\n \techo bye bye >> trunk/README &&\n-\tsvn rm -m \"gone\" $svnrepo/trunk &&\n+\tsvn rm -m 'gone' \\\"\\$svnrepo\\\"/trunk &&\n \trm -rf trunk &&\n \tmkdir trunk &&\n-\techo \"new\" > trunk/FOLLOWME &&\n-\tsvn import -m \"new trunk\" trunk $svnrepo/trunk\n-'\n+\techo 'new' > trunk/FOLLOWME &&\n+\tsvn import -m 'new trunk' trunk \\\"\\$svnrepo\\\"/trunk\n+\"\n \n-test_expect_success 'clone repo with git' '\n-\tgit svn clone -s $svnrepo x &&\n+test_expect_success 'clone repo with git' \"\n+\tgit svn clone -s \\\"\\$svnrepo\\\" x &&\n \ttest -f x/FOLLOWME &&\n \ttest ! -f x/README\n-'\n+\"\n \n-test_expect_success 'make sure r2 still has old file' '\n+test_expect_success 'make sure r2 still has old file' \"\n \tcd x &&\n-\t\ttest -n \"$(git svn find-rev r1)\" &&\n-\t\tgit reset --hard $(git svn find-rev r1) &&\n+\t\ttest -n \\\"\\$(git svn find-rev r1)\\\" &&\n+\t\tgit reset --hard \\$(git svn find-rev r1) &&\n \t\ttest -f README &&\n \t\ttest ! -f FOLLOWME &&\n-\t\ttest x$(git svn find-rev r2) = x\n-'\n+\t\ttest x\\$(git svn find-rev r2) = x\n+\"\n \n test_done\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex 7ba7630..56b1704 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -11,9 +11,9 @@ test_expect_success 'initialize repo' \"\n \tcd import &&\n \tmkdir -p trunk &&\n \techo hello > trunk/readme &&\n-\tsvn import -m 'initial' . $svnrepo &&\n+\tsvn import -m 'initial' . \\\"\\$svnrepo\\\" &&\n \tcd .. &&\n-\tsvn co $svnrepo wc &&\n+\tsvn co \\\"\\$svnrepo\\\" wc &&\n \tcd wc &&\n \techo world >> trunk/readme &&\n \tpoke trunk/readme &&\n@@ -27,7 +27,7 @@ test_expect_success 'initialize repo' \"\n \t\"\n \n test_expect_success 'init and fetch a moved directory' \"\n-\tgit-svn init --minimize-url -i thunk $svnrepo/thunk &&\n+\tgit-svn init --minimize-url -i thunk \\\"\\$svnrepo\\\"/thunk &&\n \tgit-svn fetch -i thunk &&\n \ttest \\\"\\`git rev-parse --verify refs/remotes/thunk@2\\`\\\" \\\n            = \\\"\\`git rev-parse --verify refs/remotes/thunk~1\\`\\\" &&\n@@ -38,7 +38,7 @@ test_expect_success 'init and fetch a moved directory' \"\n \t\"\n \n test_expect_success 'init and fetch from one svn-remote' \"\n-        git config svn-remote.svn.url $svnrepo &&\n+        git config svn-remote.svn.url \\\"\\$svnrepo\\\" &&\n         git config --add svn-remote.svn.fetch \\\n           trunk:refs/remotes/svn/trunk &&\n         git config --add svn-remote.svn.fetch \\\n@@ -52,9 +52,9 @@ test_expect_success 'init and fetch from one svn-remote' \"\n \n test_expect_success 'follow deleted parent' \"\n         (svn cp -m 'resurrecting trunk as junk' \\\n-               $svnrepo/trunk@2 $svnrepo/junk ||\n+               \\\"\\$svnrepo\\\"/trunk@2 \\\"\\$svnrepo\\\"/junk ||\n          svn cp -m 'resurrecting trunk as junk' \\\n-               -r2 $svnrepo/trunk $svnrepo/junk) &&\n+               -r2 \\\"\\$svnrepo\\\"/trunk \\\"\\$svnrepo\\\"/junk) &&\n         git config --add svn-remote.svn.fetch \\\n           junk:refs/remotes/svn/junk &&\n         git-svn fetch -i svn/thunk &&\n@@ -67,10 +67,10 @@ test_expect_success 'follow deleted parent' \"\n test_expect_success 'follow larger parent' \"\n         mkdir -p import/trunk/thunk/bump/thud &&\n         echo hi > import/trunk/thunk/bump/thud/file &&\n-        svn import -m 'import a larger parent' import $svnrepo/larger-parent &&\n-        svn cp -m 'hi' $svnrepo/larger-parent $svnrepo/another-larger &&\n+        svn import -m 'import a larger parent' import \\\"\\$svnrepo\\\"/larger-parent &&\n+        svn cp -m 'hi' \\\"\\$svnrepo\\\"/larger-parent \\\"\\$svnrepo\\\"/another-larger &&\n         git-svn init --minimize-url -i larger \\\n-          $svnrepo/another-larger/trunk/thunk/bump/thud &&\n+          \\\"\\$svnrepo\\\"/another-larger/trunk/thunk/bump/thud &&\n         git-svn fetch -i larger &&\n         git rev-parse --verify refs/remotes/larger &&\n         git rev-parse --verify \\\n@@ -83,23 +83,23 @@ test_expect_success 'follow larger parent' \"\n         \"\n \n test_expect_success 'follow higher-level parent' \"\n-        svn mkdir -m 'follow higher-level parent' $svnrepo/blob &&\n-        svn co $svnrepo/blob blob &&\n+        svn mkdir -m 'follow higher-level parent' \\\"\\$svnrepo\\\"/blob &&\n+        svn co \\\"\\$svnrepo\\\"/blob blob &&\n         cd blob &&\n                 echo hi > hi &&\n                 svn add hi &&\n                 svn commit -m 'hihi' &&\n                 cd ..\n-        svn mkdir -m 'new glob at top level' $svnrepo/glob &&\n-        svn mv -m 'move blob down a level' $svnrepo/blob $svnrepo/glob/blob &&\n-        git-svn init --minimize-url -i blob $svnrepo/glob/blob &&\n+        svn mkdir -m 'new glob at top level' \\\"\\$svnrepo\\\"/glob &&\n+        svn mv -m 'move blob down a level' \\\"\\$svnrepo\\\"/blob \\\"\\$svnrepo\\\"/glob/blob &&\n+        git-svn init --minimize-url -i blob \\\"\\$svnrepo\\\"/glob/blob &&\n         git-svn fetch -i blob\n         \"\n \n test_expect_success 'follow deleted directory' \"\n-\tsvn mv -m 'bye!' $svnrepo/glob/blob/hi $svnrepo/glob/blob/bye &&\n-\tsvn rm -m 'remove glob' $svnrepo/glob &&\n-\tgit-svn init --minimize-url -i glob $svnrepo/glob &&\n+\tsvn mv -m 'bye!' \\\"\\$svnrepo\\\"/glob/blob/hi \\\"\\$svnrepo\\\"/glob/blob/bye &&\n+\tsvn rm -m 'remove glob' \\\"\\$svnrepo\\\"/glob &&\n+\tgit-svn init --minimize-url -i glob \\\"\\$svnrepo\\\"/glob &&\n \tgit-svn fetch -i glob &&\n \ttest \\\"\\`git cat-file blob refs/remotes/glob:blob/bye\\`\\\" = hi &&\n \ttest \\\"\\`git ls-tree refs/remotes/glob | wc -l \\`\\\" -eq 1\n@@ -118,9 +118,9 @@ test_expect_success 'follow-parent avoids deleting relevant info' \"\n \t  echo 'bad delete test 2' > \\\n \t   import/trunk/subversion/bindings/swig/perl/another-larger &&\n \tcd import &&\n-\t  svn import -m 'r9270 test' . $svnrepo/r9270 &&\n+\t  svn import -m 'r9270 test' . \\\"\\$svnrepo\\\"/r9270 &&\n \tcd .. &&\n-\tsvn co $svnrepo/r9270/trunk/subversion/bindings/swig/perl r9270 &&\n+\tsvn co \\\"\\$svnrepo\\\"/r9270/trunk/subversion/bindings/swig/perl r9270 &&\n \tcd r9270 &&\n \t  svn mkdir native &&\n \t  svn mv t native/t &&\n@@ -130,7 +130,7 @@ test_expect_success 'follow-parent avoids deleting relevant info' \"\n \t  svn commit -m 'reorg test' &&\n \tcd .. &&\n \tgit-svn init --minimize-url -i r9270-t \\\n-\t  $svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t &&\n+\t  \\\"\\$svnrepo\\\"/r9270/trunk/subversion/bindings/swig/perl/native/t &&\n \tgit-svn fetch -i r9270-t &&\n \ttest \\`git rev-list r9270-t | wc -l\\` -eq 2 &&\n \ttest \\\"\\`git ls-tree --name-only r9270-t~1\\`\\\" = \\\n@@ -138,9 +138,9 @@ test_expect_success 'follow-parent avoids deleting relevant info' \"\n \t\"\n \n test_expect_success \"track initial change if it was only made to parent\" \"\n-\tsvn cp -m 'wheee!' $svnrepo/r9270/trunk $svnrepo/r9270/drunk &&\n+\tsvn cp -m 'wheee!' \\\"\\$svnrepo\\\"/r9270/trunk \\\"\\$svnrepo\\\"/r9270/drunk &&\n \tgit-svn init --minimize-url -i r9270-d \\\n-\t  $svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t &&\n+\t  \\\"\\$svnrepo\\\"/r9270/drunk/subversion/bindings/swig/perl/native/t &&\n \tgit-svn fetch -i r9270-d &&\n \ttest \\`git rev-list r9270-d | wc -l\\` -eq 3 &&\n \ttest \\\"\\`git ls-tree --name-only r9270-t\\`\\\" = \\\n@@ -150,7 +150,7 @@ test_expect_success \"track initial change if it was only made to parent\" \"\n \t\"\n \n test_expect_success \"track multi-parent paths\" \"\n-\tsvn cp -m 'resurrect /glob' $svnrepo/r9270 $svnrepo/glob &&\n+\tsvn cp -m 'resurrect /glob' \\\"\\$svnrepo\\\"/r9270 \\\"\\$svnrepo\\\"/glob &&\n \tgit-svn multi-fetch &&\n \ttest \\`git cat-file commit refs/remotes/glob | \\\n \t       grep '^parent ' | wc -l\\` -eq 2\n@@ -161,8 +161,8 @@ test_expect_success \"multi-fetch continues to work\" \"\n \t\"\n \n test_expect_success \"multi-fetch works off a 'clean' repository\" \"\n-\trm -r $GIT_DIR/svn $GIT_DIR/refs/remotes $GIT_DIR/logs &&\n-\tmkdir $GIT_DIR/svn &&\n+\trm -r \\\"\\$GIT_DIR/svn\\\" \\\"\\$GIT_DIR/refs/remotes\\\" \\\"\\$GIT_DIR/logs\\\" &&\n+\tmkdir \\\"\\$GIT_DIR/svn\\\" &&\n \tgit-svn multi-fetch\n \t\"\n \ndiff --git a/t/t9105-git-svn-commit-diff.sh b/t/t9105-git-svn-commit-diff.sh\nindex 318e172..4f7f9cc 100755\n--- a/t/t9105-git-svn-commit-diff.sh\n+++ b/t/t9105-git-svn-commit-diff.sh\n@@ -8,7 +8,7 @@ test_expect_success 'initialize repo' \"\n \tmkdir import &&\n \tcd import &&\n \techo hello > readme &&\n-\tsvn import -m 'initial' . $svnrepo &&\n+\tsvn import -m 'initial' . \\\"\\$svnrepo\\\" &&\n \tcd .. &&\n \techo hello > readme &&\n \tgit update-index --add readme &&\n@@ -26,17 +26,17 @@ prev=`git rev-parse --verify HEAD^1`\n \n test_expect_success 'test the commit-diff command' \"\n \ttest -n '$prev' && test -n '$head' &&\n-\tgit-svn commit-diff -r1 '$prev' '$head' '$svnrepo' &&\n-\tsvn co $svnrepo wc &&\n+\tgit-svn commit-diff -r1 '$prev' '$head' \\\"\\$svnrepo\\\" &&\n+\tsvn co \\\"\\$svnrepo\\\" wc &&\n \tcmp readme wc/readme\n \t\"\n \n test_expect_success 'commit-diff to a sub-directory (with git-svn config)' \"\n-\tsvn import -m 'sub-directory' import $svnrepo/subdir &&\n-\tgit-svn init --minimize-url $svnrepo/subdir &&\n+\tsvn import -m 'sub-directory' import \\\"\\$svnrepo\\\"/subdir &&\n+\tgit-svn init --minimize-url \\\"\\$svnrepo\\\"/subdir &&\n \tgit-svn fetch &&\n \tgit-svn commit-diff -r3 '$prev' '$head' &&\n-\tsvn cat $svnrepo/subdir/readme > readme.2 &&\n+\tsvn cat \\\"\\$svnrepo\\\"/subdir/readme > readme.2 &&\n \tcmp readme readme.2\n \t\"\n \ndiff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh\nindex f74ab12..bb544f6 100755\n--- a/t/t9106-git-svn-commit-diff-clobber.sh\n+++ b/t/t9106-git-svn-commit-diff-clobber.sh\n@@ -8,14 +8,14 @@ test_expect_success 'initialize repo' \"\n \tmkdir import &&\n \tcd import &&\n \techo initial > file &&\n-\tsvn import -m 'initial' . $svnrepo &&\n+\tsvn import -m 'initial' . \\\"\\$svnrepo\\\" &&\n \tcd .. &&\n \techo initial > file &&\n \tgit update-index --add file &&\n \tgit commit -a -m 'initial'\n \t\"\n test_expect_success 'commit change from svn side' \"\n-\tsvn co $svnrepo t.svn &&\n+\tsvn co \\\"\\$svnrepo\\\" t.svn &&\n \tcd t.svn &&\n \techo second line from svn >> file &&\n \tpoke file &&\n@@ -27,7 +27,7 @@ test_expect_success 'commit change from svn side' \"\n test_expect_success 'commit conflicting change from git' \"\n \techo second line from git >> file &&\n \tgit commit -a -m 'second line from git' &&\n-\t! git-svn commit-diff -r1 HEAD~1 HEAD $svnrepo\n+\t! git-svn commit-diff -r1 HEAD~1 HEAD \\\"\\$svnrepo\\\"\n \"\n \n test_expect_success 'commit complementing change from git' \"\n@@ -36,14 +36,14 @@ test_expect_success 'commit complementing change from git' \"\n \tgit commit -a -m 'second line from svn' &&\n \techo third line from git >> file &&\n \tgit commit -a -m 'third line from git' &&\n-\tgit-svn commit-diff -r2 HEAD~1 HEAD $svnrepo\n+\tgit-svn commit-diff -r2 HEAD~1 HEAD \\\"\\$svnrepo\\\"\n \t\"\n \n test_expect_success 'dcommit fails to commit because of conflict' \"\n-\tgit-svn init $svnrepo &&\n+\tgit-svn init \\\"\\$svnrepo\\\" &&\n \tgit-svn fetch &&\n \tgit reset --hard refs/remotes/git-svn &&\n-\tsvn co $svnrepo t.svn &&\n+\tsvn co \\\"\\$svnrepo\\\" t.svn &&\n \tcd t.svn &&\n \techo fourth line from svn >> file &&\n \tpoke file &&\n@@ -67,7 +67,7 @@ test_expect_success 'dcommit does the svn equivalent of an index merge' \"\n \t\"\n \n test_expect_success 'commit another change from svn side' \"\n-\tsvn co $svnrepo t.svn &&\n+\tsvn co \\\"\\$svnrepo\\\" t.svn &&\n \tcd t.svn &&\n \t\techo third line from svn >> file &&\n \t\tpoke file &&\ndiff --git a/t/t9106-git-svn-dcommit-clobber-series.sh b/t/t9106-git-svn-dcommit-clobber-series.sh\nindex ca8a00e..477755a 100755\n--- a/t/t9106-git-svn-dcommit-clobber-series.sh\n+++ b/t/t9106-git-svn-dcommit-clobber-series.sh\n@@ -8,9 +8,9 @@ test_expect_success 'initialize repo' \"\n \tmkdir import &&\n \tcd import &&\n \tawk 'BEGIN { for (i = 1; i < 64; i++) { print i } }' > file\n-\tsvn import -m 'initial' . $svnrepo &&\n+\tsvn import -m 'initial' . \\\"\\$svnrepo\\\" &&\n \tcd .. &&\n-\tgit svn init $svnrepo &&\n+\tgit svn init \\\"\\$svnrepo\\\" &&\n \tgit svn fetch &&\n \ttest -e file\n \t\"\n@@ -18,7 +18,7 @@ test_expect_success 'initialize repo' \"\n test_expect_success '(supposedly) non-conflicting change from SVN' \"\n \ttest x\\\"\\`sed -n -e 58p < file\\`\\\" = x58 &&\n \ttest x\\\"\\`sed -n -e 61p < file\\`\\\" = x61 &&\n-\tsvn co $svnrepo tmp &&\n+\tsvn co \\\"\\$svnrepo\\\" tmp &&\n \tcd tmp &&\n \t\tperl -i -p -e 's/^58\\$/5588/' file &&\n \t\tperl -i -p -e 's/^61\\$/6611/' file &&\ndiff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh\nindex 0a41d52..9ab7074 100755\n--- a/t/t9107-git-svn-migrate.sh\n+++ b/t/t9107-git-svn-migrate.sh\n@@ -4,7 +4,7 @@ test_description='git-svn metadata migrations from previous versions'\n . ./lib-git-svn.sh\n \n test_expect_success 'setup old-looking metadata' \"\n-\tcp $GIT_DIR/config $GIT_DIR/config-old-git-svn &&\n+\tcp \\\"\\$GIT_DIR\\\"/config \\\"\\$GIT_DIR\\\"/config-old-git-svn &&\n \tmkdir import &&\n \tcd import &&\n \t\tfor i in trunk branches/a branches/b \\\n@@ -12,13 +12,13 @@ test_expect_success 'setup old-looking metadata' \"\n \t\t\tmkdir -p \\$i && \\\n \t\t\techo hello >> \\$i/README || exit 1\n \t\tdone && \\\n-\t\tsvn import -m test . $svnrepo\n+\t\tsvn import -m test . \\\"\\$svnrepo\\\"\n \t\tcd .. &&\n-\tgit-svn init $svnrepo &&\n+\tgit-svn init \\\"\\$svnrepo\\\" &&\n \tgit-svn fetch &&\n-\tmv $GIT_DIR/svn/* $GIT_DIR/ &&\n-\tmv $GIT_DIR/svn/.metadata $GIT_DIR/ &&\n-\trmdir $GIT_DIR/svn &&\n+\tmv \\\"\\$GIT_DIR\\\"/svn/* \\\"\\$GIT_DIR\\\"/ &&\n+\tmv \\\"\\$GIT_DIR\\\"/svn/.metadata \\\"\\$GIT_DIR\\\"/ &&\n+\trmdir \\\"\\$GIT_DIR\\\"/svn &&\n \tgit update-ref refs/heads/git-svn-HEAD refs/remotes/git-svn &&\n \tgit update-ref refs/heads/svn-HEAD refs/remotes/git-svn &&\n \tgit update-ref -d refs/remotes/git-svn refs/remotes/git-svn\n@@ -28,20 +28,20 @@ head=`git rev-parse --verify refs/heads/git-svn-HEAD^0`\n test_expect_success 'git-svn-HEAD is a real HEAD' \"test -n '$head'\"\n \n test_expect_success 'initialize old-style (v0) git-svn layout' \"\n-\tmkdir -p $GIT_DIR/git-svn/info $GIT_DIR/svn/info &&\n-\techo $svnrepo > $GIT_DIR/git-svn/info/url &&\n-\techo $svnrepo > $GIT_DIR/svn/info/url &&\n+\tmkdir -p \\\"\\$GIT_DIR\\\"/git-svn/info \\\"\\$GIT_DIR\\\"/svn/info &&\n+\techo \\\"\\$svnrepo\\\" > \\\"\\$GIT_DIR\\\"/git-svn/info/url &&\n+\techo \\\"\\$svnrepo\\\" > \\\"\\$GIT_DIR\\\"/svn/info/url &&\n \tgit-svn migrate &&\n-\t! test -d $GIT_DIR/git-svn &&\n+\t! test -d \\\"\\$GIT_DIR\\\"/git-svn &&\n \tgit rev-parse --verify refs/remotes/git-svn^0 &&\n \tgit rev-parse --verify refs/remotes/svn^0 &&\n-\ttest \\`git config --get svn-remote.svn.url\\` = '$svnrepo' &&\n+\ttest \\\"\\$(git config --get svn-remote.svn.url)\\\" = \\\"\\$svnrepo\\\" &&\n \ttest \\`git config --get svn-remote.svn.fetch\\` = \\\n              ':refs/remotes/git-svn'\n \t\"\n \n test_expect_success 'initialize a multi-repository repo' \"\n-\tgit-svn init $svnrepo -T trunk -t tags -b branches &&\n+\tgit-svn init \\\"\\$svnrepo\\\" -T trunk -t tags -b branches &&\n \tgit config --get-all svn-remote.svn.fetch > fetch.out &&\n \tgrep '^trunk:refs/remotes/trunk$' fetch.out &&\n \ttest -n \\\"\\`git config --get svn-remote.svn.branches \\\n@@ -76,14 +76,14 @@ test_expect_success 'multi-fetch works on partial urls + paths' \"\n test_expect_success 'migrate --minimize on old inited layout' \"\n \tgit config --unset-all svn-remote.svn.fetch &&\n \tgit config --unset-all svn-remote.svn.url &&\n-\trm -rf $GIT_DIR/svn &&\n+\trm -rf \\\"\\$GIT_DIR\\\"/svn &&\n \tfor i in \\`cat fetch.out\\`; do\n \t\tpath=\\`expr \\$i : '\\\\([^:]*\\\\):.*$'\\`\n \t\tref=\\`expr \\$i : '[^:]*:refs/remotes/\\\\(.*\\\\)$'\\`\n \t\tif test -z \\\"\\$ref\\\"; then continue; fi\n \t\tif test -n \\\"\\$path\\\"; then path=\\\"/\\$path\\\"; fi\n-\t\t( mkdir -p $GIT_DIR/svn/\\$ref/info/ &&\n-\t\techo $svnrepo\\$path > $GIT_DIR/svn/\\$ref/info/url ) || exit 1;\n+\t\t( mkdir -p \\\"\\$GIT_DIR\\\"/svn/\\$ref/info/ &&\n+\t\techo \\\"\\$svnrepo\\\"\\$path > \\\"\\$GIT_DIR\\\"/svn/\\$ref/info/url ) || exit 1;\n \tdone &&\n \tgit-svn migrate --minimize &&\n \ttest -z \\\"\\`git config -l |grep -v '^svn-remote\\.git-svn\\.'\\`\\\" &&\n@@ -99,17 +99,17 @@ test_expect_success 'migrate --minimize on old inited layout' \"\n \n test_expect_success  \".rev_db auto-converted to .rev_map.UUID\" \"\n \tgit-svn fetch -i trunk &&\n-\ttest -z \\\"\\$(ls $GIT_DIR/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n-\texpect=\\\"\\$(ls $GIT_DIR/svn/trunk/.rev_map.*)\\\" &&\n+\ttest -z \\\"\\$(ls \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n+\texpect=\\\"\\$(ls \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_map.*)\\\" &&\n \ttest -n \\\"\\$expect\\\" &&\n-\trev_db=\\$(echo \\$expect | sed -e 's,_map,_db,') &&\n-\tconvert_to_rev_db \\$expect \\$rev_db &&\n-\trm -f \\$expect &&\n-\ttest -f \\$rev_db &&\n+\trev_db=\\\"\\$(echo \\$expect | sed -e 's,_map,_db,')\\\" &&\n+\tconvert_to_rev_db \\\"\\$expect\\\" \\\"\\$rev_db\\\" &&\n+\trm -f \\\"\\$expect\\\" &&\n+\ttest -f \\\"\\$rev_db\\\" &&\n \tgit-svn fetch -i trunk &&\n-\ttest -z \\\"\\$(ls $GIT_DIR/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n-\ttest ! -e $GIT_DIR/svn/trunk/.rev_db &&\n-\ttest -f \\$expect\n+\ttest -z \\\"\\$(ls \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n+\ttest ! -e \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_db &&\n+\ttest -f \\\"\\$expect\\\"\n \t\"\n \n test_done\ndiff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh\nindex db4344c..8f03f2d 100755\n--- a/t/t9108-git-svn-glob.sh\n+++ b/t/t9108-git-svn-glob.sh\n@@ -14,8 +14,8 @@ test_expect_success 'test refspec globbing' \"\n \tmkdir -p trunk/src/a trunk/src/b trunk/doc &&\n \techo 'hello world' > trunk/src/a/readme &&\n \techo 'goodbye world' > trunk/src/b/readme &&\n-\tsvn import -m 'initial' trunk $svnrepo/trunk &&\n-\tsvn co $svnrepo tmp &&\n+\tsvn import -m 'initial' trunk \\\"\\$svnrepo\\\"/trunk &&\n+\tsvn co \\\"\\$svnrepo\\\" tmp &&\n \tcd tmp &&\n \t\tmkdir branches tags &&\n \t\tsvn add branches tags &&\n@@ -38,7 +38,7 @@ test_expect_success 'test refspec globbing' \"\n \t\tpoke tags/end/src/b/readme &&\n \t\tsvn commit -m 'nothing to see here'\n \t\tcd .. &&\n-\tgit config --add svn-remote.svn.url $svnrepo &&\n+\tgit config --add svn-remote.svn.url \\\"\\$svnrepo\\\" &&\n \tgit config --add svn-remote.svn.fetch \\\n \t                 'trunk/src/a:refs/remotes/trunk' &&\n \tgit config --add svn-remote.svn.branches \\\n@@ -60,7 +60,7 @@ echo nothing to see here >> expect.two\n cat expect.end >> expect.two\n \n test_expect_success 'test left-hand-side only globbing' \"\n-\tgit config --add svn-remote.two.url $svnrepo &&\n+\tgit config --add svn-remote.two.url \\\"\\$svnrepo\\\" &&\n \tgit config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk &&\n \tgit config --add svn-remote.two.branches \\\n \t                 'branches/*:refs/remotes/two/branches/*' &&\ndiff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh\nindex 6235af4..d9ac558 100755\n--- a/t/t9110-git-svn-use-svm-props.sh\n+++ b/t/t9110-git-svn-use-svm-props.sh\n@@ -8,11 +8,11 @@ test_description='git-svn useSvmProps test'\n . ./lib-git-svn.sh\n \n test_expect_success 'load svm repo' \"\n-\tsvnadmin load -q $rawsvnrepo < ../t9110/svm.dump &&\n-\tgit-svn init --minimize-url -R arr -i bar $svnrepo/mirror/arr &&\n-\tgit-svn init --minimize-url -R argh -i dir $svnrepo/mirror/argh &&\n+\tsvnadmin load -q \\\"\\$rawsvnrepo\\\" < ../t9110/svm.dump &&\n+\tgit-svn init --minimize-url -R arr -i bar \\\"\\$svnrepo\\\"/mirror/arr &&\n+\tgit-svn init --minimize-url -R argh -i dir \\\"\\$svnrepo\\\"/mirror/argh &&\n \tgit-svn init --minimize-url -R argh -i e \\\n-\t  $svnrepo/mirror/argh/a/b/c/d/e &&\n+\t  \\\"\\$svnrepo\\\"/mirror/argh/a/b/c/d/e &&\n \tgit config svn.useSvmProps true &&\n \tgit-svn fetch --all\n \t\"\ndiff --git a/t/t9111-git-svn-use-svnsync-props.sh b/t/t9111-git-svn-use-svnsync-props.sh\nindex ec7dedd..77185bc 100755\n--- a/t/t9111-git-svn-use-svnsync-props.sh\n+++ b/t/t9111-git-svn-use-svnsync-props.sh\n@@ -8,10 +8,10 @@ test_description='git-svn useSvnsyncProps test'\n . ./lib-git-svn.sh\n \n test_expect_success 'load svnsync repo' \"\n-\tsvnadmin load -q $rawsvnrepo < ../t9111/svnsync.dump &&\n-\tgit-svn init --minimize-url -R arr -i bar $svnrepo/bar &&\n-\tgit-svn init --minimize-url -R argh -i dir $svnrepo/dir &&\n-\tgit-svn init --minimize-url -R argh -i e $svnrepo/dir/a/b/c/d/e &&\n+\tsvnadmin load -q \\\"\\$rawsvnrepo\\\" < ../t9111/svnsync.dump &&\n+\tgit-svn init --minimize-url -R arr -i bar \\\"\\$svnrepo\\\"/bar &&\n+\tgit-svn init --minimize-url -R argh -i dir \\\"\\$svnrepo\\\"/dir &&\n+\tgit-svn init --minimize-url -R argh -i e \\\"\\$svnrepo\\\"/dir/a/b/c/d/e &&\n \tgit config svn.useSvnsyncProps true &&\n \tgit-svn fetch --all\n \t\"\ndiff --git a/t/t9112-git-svn-md5less-file.sh b/t/t9112-git-svn-md5less-file.sh\nindex 646a5f0..fb1491d 100755\n--- a/t/t9112-git-svn-md5less-file.sh\n+++ b/t/t9112-git-svn-md5less-file.sh\n@@ -40,8 +40,8 @@ PROPS-END\n \n EOF\n \n-test_expect_success 'load svn dumpfile' \"svnadmin load $rawsvnrepo < dumpfile.svn\"\n+test_expect_success 'load svn dumpfile' \"svnadmin load \\\"\\$rawsvnrepo\\\" < dumpfile.svn\"\n \n-test_expect_success 'initialize git-svn' \"git-svn init $svnrepo\"\n+test_expect_success 'initialize git-svn' \"git-svn init \\\"\\$svnrepo\\\"\"\n test_expect_success 'fetch revisions from svn' 'git-svn fetch'\n test_done\ndiff --git a/t/t9113-git-svn-dcommit-new-file.sh b/t/t9113-git-svn-dcommit-new-file.sh\nindex 9ef0db9..b92a64e 100755\n--- a/t/t9113-git-svn-dcommit-new-file.sh\n+++ b/t/t9113-git-svn-dcommit-new-file.sh\n@@ -15,14 +15,14 @@ test_description='git-svn dcommit new files over svn:// test'\n \n start_svnserve () {\n \tsvnserve --listen-port $SVNSERVE_PORT \\\n-\t         --root $rawsvnrepo \\\n+\t         --root \"$rawsvnrepo\" \\\n \t         --listen-once \\\n \t         --listen-host 127.0.0.1 &\n }\n \n test_expect_success 'start tracking an empty repo' \"\n-\tsvn mkdir -m 'empty dir' $svnrepo/empty-dir &&\n-\techo anon-access = write >> $rawsvnrepo/conf/svnserve.conf &&\n+\tsvn mkdir -m 'empty dir' \\\"\\$svnrepo\\\"/empty-dir &&\n+\techo anon-access = write >> \\\"\\$rawsvnrepo\\\"/conf/svnserve.conf &&\n \tstart_svnserve &&\n \tgit svn init svn://127.0.0.1:$SVNSERVE_PORT &&\n \tgit svn fetch\ndiff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh\nindex 225060b..74b971c 100755\n--- a/t/t9114-git-svn-dcommit-merge.sh\n+++ b/t/t9114-git-svn-dcommit-merge.sh\n@@ -35,7 +35,7 @@ EOF\n }\n \n test_expect_success 'setup svn repository' \"\n-\tsvn co $svnrepo mysvnwork &&\n+\tsvn co \\\"\\$svnrepo\\\" mysvnwork &&\n \tmkdir -p mysvnwork/trunk &&\n \tcd mysvnwork &&\n \t\tbig_text_block >> trunk/README &&\n@@ -45,7 +45,7 @@ test_expect_success 'setup svn repository' \"\n \t\"\n \n test_expect_success 'setup git mirror and merge' \"\n-\tgit svn init $svnrepo -t tags -T trunk -b branches &&\n+\tgit svn init \\\"\\$svnrepo\\\" -t tags -T trunk -b branches &&\n \tgit svn fetch &&\n \tgit checkout --track -b svn remotes/trunk &&\n \tgit checkout -b merge &&\ndiff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh\nindex 182299c..f83f4f9 100755\n--- a/t/t9115-git-svn-dcommit-funky-renames.sh\n+++ b/t/t9115-git-svn-dcommit-funky-renames.sh\n@@ -8,12 +8,12 @@ test_description='git-svn dcommit can commit renames of files with ugly names'\n . ./lib-git-svn.sh\n \n test_expect_success 'load repository with strange names' \"\n-\tsvnadmin load -q $rawsvnrepo < ../t9115/funky-names.dump &&\n+\tsvnadmin load -q \\\"\\$rawsvnrepo\\\" < ../t9115/funky-names.dump &&\n \tstart_httpd\n \t\"\n \n test_expect_success 'init and fetch repository' \"\n-\tgit svn init $svnrepo &&\n+\tgit svn init \\\"\\$svnrepo\\\" &&\n \tgit svn fetch &&\n \tgit reset --hard git-svn\n \t\"\ndiff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh\nindex e1e8bdf..13081b8 100755\n--- a/t/t9116-git-svn-log.sh\n+++ b/t/t9116-git-svn-log.sh\n@@ -14,9 +14,9 @@ test_expect_success 'setup repository and import' \"\n \t\t\tmkdir -p \\$i && \\\n \t\t\techo hello >> \\$i/README || exit 1\n \t\tdone && \\\n-\t\tsvn import -m test . $svnrepo\n+\t\tsvn import -m test . \\\"\\$svnrepo\\\"\n \t\tcd .. &&\n-\tgit-svn init $svnrepo -T trunk -b branches -t tags &&\n+\tgit-svn init \\\"\\$svnrepo\\\" -T trunk -b branches -t tags &&\n \tgit-svn fetch &&\n \tgit reset --hard trunk &&\n \techo bye >> README &&\ndiff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh\nindex d482b40..c924915 100755\n--- a/t/t9117-git-svn-init-clone.sh\n+++ b/t/t9117-git-svn-init-clone.sh\n@@ -16,13 +16,13 @@ cd tmp\n test_expect_success 'setup svnrepo' \"\n \tmkdir project project/trunk project/branches project/tags &&\n \techo foo > project/trunk/foo &&\n-\tsvn import -m '$test_description' project $svnrepo/project &&\n+\tsvn import -m '$test_description' project \\\"\\$svnrepo\\\"/project &&\n \trm -rf project\n \t\"\n \n test_expect_success 'basic clone' \"\n \ttest ! -d trunk &&\n-\tgit svn clone $svnrepo/project/trunk &&\n+\tgit svn clone \\\"\\$svnrepo\\\"/project/trunk &&\n \ttest -d trunk/.git/svn &&\n \ttest -e trunk/foo &&\n \trm -rf trunk\n@@ -30,7 +30,7 @@ test_expect_success 'basic clone' \"\n \n test_expect_success 'clone to target directory' \"\n \ttest ! -d target &&\n-\tgit svn clone $svnrepo/project/trunk target &&\n+\tgit svn clone \\\"\\$svnrepo\\\"/project/trunk target &&\n \ttest -d target/.git/svn &&\n \ttest -e target/foo &&\n \trm -rf target\n@@ -38,7 +38,7 @@ test_expect_success 'clone to target directory' \"\n \n test_expect_success 'clone with --stdlayout' \"\n \ttest ! -d project &&\n-\tgit svn clone -s $svnrepo/project &&\n+\tgit svn clone -s \\\"\\$svnrepo\\\"/project &&\n \ttest -d project/.git/svn &&\n \ttest -e project/foo &&\n \trm -rf project\n@@ -46,7 +46,7 @@ test_expect_success 'clone with --stdlayout' \"\n \n test_expect_success 'clone to target directory with --stdlayout' \"\n \ttest ! -d target &&\n-\tgit svn clone -s $svnrepo/project target &&\n+\tgit svn clone -s \\\"\\$svnrepo\\\"/project target &&\n \ttest -d target/.git/svn &&\n \ttest -e target/foo &&\n \trm -rf target\ndiff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh\nindex 640bb06..0f107fc 100755\n--- a/t/t9118-git-svn-funky-branch-names.sh\n+++ b/t/t9118-git-svn-funky-branch-names.sh\n@@ -9,17 +9,17 @@ test_description='git-svn funky branch names'\n test_expect_success 'setup svnrepo' \"\n \tmkdir project project/trunk project/branches project/tags &&\n \techo foo > project/trunk/foo &&\n-\tsvn import -m '$test_description' project \\\"$svnrepo/pr ject\\\" &&\n+\tsvn import -m '\\$test_description' project \\\"\\$svnrepo/pr ject\\\" &&\n \trm -rf project &&\n-\tsvn cp -m 'fun' \\\"$svnrepo/pr ject/trunk\\\" \\\n-\t                \\\"$svnrepo/pr ject/branches/fun plugin\\\" &&\n-\tsvn cp -m 'more fun!' \\\"$svnrepo/pr ject/branches/fun plugin\\\" \\\n-\t                      \\\"$svnrepo/pr ject/branches/more fun plugin!\\\" &&\n+\tsvn cp -m 'fun' \\\"\\$svnrepo/pr ject/trunk\\\" \\\n+\t                \\\"\\$svnrepo/pr ject/branches/fun plugin\\\" &&\n+\tsvn cp -m 'more fun!' \\\"\\$svnrepo/pr ject/branches/fun plugin\\\" \\\n+\t                      \\\"\\$svnrepo/pr ject/branches/more fun plugin!\\\" &&\n \tstart_httpd\n \t\"\n \n test_expect_success 'test clone with funky branch names' \"\n-\tgit svn clone -s \\\"$svnrepo/pr ject\\\" project &&\n+\tgit svn clone -s \\\"\\$svnrepo/pr ject\\\" project &&\n \tcd project &&\n \t\tgit rev-parse 'refs/remotes/fun%20plugin' &&\n \t\tgit rev-parse 'refs/remotes/more%20fun%20plugin!' &&\ndiff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh\nindex 9a4eabe..1414c0f 100755\n--- a/t/t9120-git-svn-clone-with-percent-escapes.sh\n+++ b/t/t9120-git-svn-clone-with-percent-escapes.sh\n@@ -9,7 +9,7 @@ test_description='git-svn clone with percent escapes'\n test_expect_success 'setup svnrepo' \"\n \tmkdir project project/trunk project/branches project/tags &&\n \techo foo > project/trunk/foo &&\n-\tsvn import -m '$test_description' project '$svnrepo/pr ject' &&\n+\tsvn import -m \\\"\\$test_description\\\" project \\\"\\$svnrepo/pr ject\\\" &&\n \trm -rf project &&\n \tstart_httpd\n \"\ndiff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\nindex 796cd7d..0f36e6c 100755\n--- a/t/t9500-gitweb-standalone-no-errors.sh\n+++ b/t/t9500-gitweb-standalone-no-errors.sh\n@@ -10,6 +10,7 @@ commandline, and checks that it would not write any errors\n or warnings to log.'\n \n gitweb_init () {\n+\tsafe_pwd=\"$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')\"\n \tcat >gitweb_config.perl <<EOF\n #!/usr/bin/perl\n \n@@ -17,16 +18,16 @@ gitweb_init () {\n \n our \\$version = \"current\";\n our \\$GIT = \"git\";\n-our \\$projectroot = \"$(pwd)\";\n+our \\$projectroot = \"$safe_pwd\";\n our \\$project_maxdepth = 8;\n our \\$home_link_str = \"projects\";\n our \\$site_name = \"[localhost]\";\n our \\$site_header = \"\";\n our \\$site_footer = \"\";\n our \\$home_text = \"indextext.html\";\n-our @stylesheets = (\"file:///$(pwd)/../../gitweb/gitweb.css\");\n-our \\$logo = \"file:///$(pwd)/../../gitweb/git-logo.png\";\n-our \\$favicon = \"file:///$(pwd)/../../gitweb/git-favicon.png\";\n+our @stylesheets = (\"file:///$safe_pwd/../../gitweb/gitweb.css\");\n+our \\$logo = \"file:///$safe_pwd/../../gitweb/git-logo.png\";\n+our \\$favicon = \"file:///$safe_pwd/../../gitweb/git-favicon.png\";\n our \\$projects_list = \"\";\n our \\$export_ok = \"\";\n our \\$strict_export = \"\";\n@@ -45,13 +46,13 @@ gitweb_run () {\n \texport QUERY_STRING=\"\"$1\"\"\n \texport PATH_INFO=\"\"$2\"\"\n \n-\texport GITWEB_CONFIG=$(pwd)/gitweb_config.perl\n+\texport GITWEB_CONFIG=\"$(pwd)/gitweb_config.perl\"\n \n \t# some of git commands write to STDERR on error, but this is not\n \t# written to web server logs, so we are not interested in that:\n \t# we are interested only in properly formatted errors/warnings\n \trm -f gitweb.log &&\n-\tperl -- $(pwd)/../../gitweb/gitweb.perl \\\n+\tperl -- \"$(pwd)/../../gitweb/gitweb.perl\" \\\n \t\t>/dev/null 2>gitweb.log &&\n \tif grep -q -s \"^[[]\" gitweb.log >/dev/null; then false; else true; fi\n \n-- \n1.5.5.8.gbbd98\n"},{"id":"73922","messageId":"47FC62B0.3060802@viscovery.net","threadId":"13032","inReplyTo":"1207704604-30393-2-git-send-email-bdonlan@fushizen.net","subject":"Re: [PATCH 2/8] config.c: Escape backslashes in section names properly","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-04-09T06:31:12Z","receivedAt":"2008-04-09T06:31:12Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Bryan Donlan schrieb:\n> Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n\nWhat is your definition of \"properly\"? Please give an example of what went\nwrong.\n\n-- Hannes\n"},{"id":"73921","messageId":"47FC62B6.9020304@viscovery.net","threadId":"13032","inReplyTo":"1207704604-30393-3-git-send-email-bdonlan@fushizen.net","subject":"Re: [PATCH 3/8] git-send-email.perl: Handle shell metacharacters in $EDITOR properly","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-04-09T06:31:18Z","receivedAt":"2008-04-09T06:31:18Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Bryan Donlan schrieb:\n> Also, update t/t9001-send-email.sh to test for this bug.\n> \n> Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n\nYour defintion of \"properly\"? I didn't immediately see what is wrong with\nthe status quo and, hence, why your fix would solve a problem.\n\n-- Hannes\n"},{"id":"73924","messageId":"47FC6400.8010606@viscovery.net","threadId":"13032","inReplyTo":"1207704604-30393-5-git-send-email-bdonlan@fushizen.net","subject":"Re: [PATCH 5/8] test-lib.sh: Add a test_set_editor function to safely set $VISUAL","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-04-09T06:36:48Z","receivedAt":"2008-04-09T06:36:48Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Bryan Donlan schrieb:\n> +test_set_editor () {\n> +\t# If the editor path contains a quote, just using VISUAL='\"path\"' isn't\n> +\t# enough.\n> +\tFAKE_EDITOR=\"$1\"\n> +\texport FAKE_EDITOR\n> +\tVISUAL='\"$FAKE_EDITOR\"'\n> +\texport VISUAL\n\nClever! It assumes that $VISUAL is always run as sh -c \"$VISUAL ...\", but\nI think this assumption is valid. A hint along these lines in the comment\ncould turn out helpful.\n\n-- Hannes\n"},{"id":"73927","messageId":"7v63urcyis.fsf@gitster.siamese.dyndns.org","threadId":"13032","inReplyTo":"1207704604-30393-6-git-send-email-bdonlan@fushizen.net","subject":"Re: [PATCH 6/8] lib-git-svn.sh: Fix quoting issues with paths containing shell metacharacters","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-09T06:50:35Z","receivedAt":"2008-04-09T06:50:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bryan Donlan <bdonlan@fushizen.net> writes:\n\n> Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n> ---\n>  t/lib-git-svn.sh |   11 ++++++-----\n>  1 files changed, 6 insertions(+), 5 deletions(-)\n>\n> diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\n> index 9decd2e..1b37ba8 100644\n> --- a/t/lib-git-svn.sh\n> +++ b/t/lib-git-svn.sh\n> @@ -7,9 +7,9 @@ then\n>  \texit\n>  fi\n>  \n> -GIT_DIR=$PWD/.git\n> -GIT_SVN_DIR=$GIT_DIR/svn/git-svn\n> -SVN_TREE=$GIT_SVN_DIR/svn-tree\n> +GIT_DIR=\"$PWD/.git\"\n> +GIT_SVN_DIR=\"$GIT_DIR/svn/git-svn\"\n> +SVN_TREE=\"$GIT_SVN_DIR/svn-tree\"\n\nSame comment as the one for [1/8].\n\n>  \n>  svn >/dev/null 2>&1\n>  if test $? -ne 1\n> @@ -19,13 +19,14 @@ then\n>      exit\n>  fi\n>  \n> -svnrepo=$PWD/svnrepo\n> +svnrepo=\"$PWD/svnrepo\"\n> +export svnrepo\n\nLikewise, except \"export\" is a good way to propagate it down.\n\n>  perl -w -e \"\n>  use SVN::Core;\n>  use SVN::Repos;\n>  \\$SVN::Core::VERSION gt '1.1.0' or exit(42);\n> -system(qw/svnadmin create --fs-type fsfs/, '$svnrepo') == 0 or exit(41);\n> +system(qw/svnadmin create --fs-type fsfs/, \\$ENV{svnrepo}) == 0 or exit(41);\n>  \" >&3 2>&4\n>  x=$?\n>  if test $x -ne 0\n"},{"id":"73928","messageId":"7vzls3bjxz.fsf@gitster.siamese.dyndns.org","threadId":"13032","inReplyTo":"1207704604-30393-1-git-send-email-bdonlan@fushizen.net","subject":"Re: [PATCH 1/8] git-rebase.sh: Fix --merge --abort failures when path contains whitespace","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-09T06:50:48Z","receivedAt":"2008-04-09T06:50:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bryan Donlan <bdonlan@fushizen.net> writes:\n\n> @@ -42,7 +42,7 @@ To restore the original branch and stop rebasing run \\\"git rebase --abort\\\".\n>  unset newbase\n>  strategy=recursive\n>  do_merge=\n> -dotest=$GIT_DIR/.dotest-merge\n> +dotest=\"$GIT_DIR/.dotest-merge\"\n>  prec=4\n>  verbose=\n>  git_am_opt=\n\nThis dq should not be necessary.\n\nThe rest of this looked fine.\n"},{"id":"73930","messageId":"47FC6863.8070704@viscovery.net","threadId":"13032","inReplyTo":"1207704604-30393-1-git-send-email-bdonlan@fushizen.net","subject":"Re: [PATCH 1/8] git-rebase.sh: Fix --merge --abort failures when path contains whitespace","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-04-09T06:55:31Z","receivedAt":"2008-04-09T06:55:31Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Bryan Donlan schrieb:\n> -dotest=$GIT_DIR/.dotest-merge\n> +dotest=\"$GIT_DIR/.dotest-merge\"\n\nThis is not strictly necessary: The RHS expression of an assignment does\nnot undergo IFS splitting; but better safe than sorry. (But note that\n'export foo=$bar', which is not POSIX, is *not* an assignment, and\ndifferent shells that support this construct treat it differently.)\n\n> +### Test that we handle strange characters properly\n> +work_dir=\"$(pwd)/test \\\" ' \\$ \\\\ dir\"\n\nIn effect, you modify only this test to stress-test strange characters,\nbut other tests in the test suite still run in a \"sane\" environment. IOW,\nI don't think you should go to this extreme for this one test only. The\nbetter approach would be to rename 'trash' in test-lib.sh to this strange\nname so that all tests suffer from a challenging environment.\n\n> -\t\tgit reset --hard pre-rebase\n> -\t\ttest_must_fail git rebase'\"$type\"' master &&\n> -\t\ttest -d '$dotest' &&\n> +\t\tgit reset --hard pre-rebase &&\n> +\t\ttest_must_fail git rebase$type master &&\n> +\t\ttest -d \\\"\\$dotest\\\" &&\n\nI could imagine that the missing && after the git reset is deliberate. Mike?\n\n> +\t\tgit reset --hard pre-rebase &&\n\nDitto.\n\nApart from that, this looks good.\n\n-- Hannes\n"},{"id":"73931","messageId":"47FC69CB.1080400@viscovery.net","threadId":"13032","inReplyTo":"1207704604-30393-7-git-send-email-bdonlan@fushizen.net","subject":"Re: [PATCH 7/8] Use test_set_editor in t9001-send-email.sh","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-04-09T07:01:31Z","receivedAt":"2008-04-09T07:01:31Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Bryan Donlan schrieb:\n> diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\n> index 030f66c..0a65785 100755\n> --- a/t/t9001-send-email.sh\n> +++ b/t/t9001-send-email.sh\n> @@ -144,10 +144,7 @@ test_expect_success 'setup fake editor' '\n>  \tchmod +x fake-editor\n>  '\n>  \n> -FAKE_EDITOR=\"$(pwd)/fake-editor\"\n> -export FAKE_EDITOR\n> -GIT_EDITOR='\"$FAKE_EDITOR\"'\n> -export GIT_EDITOR\n> +test_set_editor \"$(pwd)/fake-editor\"\n>  \n>  test_expect_success '--compose works' '\n>  \tclean_fake_sendmail &&\n\nI'd squash this into 5/8 or 8/8. Dunno.\n\n-- Hannes\n"},{"id":"73957","messageId":"20080409141334.GA24402@shion.is.fushizen.net","threadId":"13032","inReplyTo":"47FC62B0.3060802@viscovery.net","subject":"Re: [PATCH 2/8] config.c: Escape backslashes in section names properly","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-09T14:13:34Z","receivedAt":"2008-04-09T14:13:34Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"On Wed, Apr 09, 2008 at 08:31:12AM +0200, Johannes Sixt wrote:\n> Bryan Donlan schrieb:\n> > Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n> \n> What is your definition of \"properly\"? Please give an example of what went\n> wrong.\n\nThe included patch to the test suite is an example - specifically if an\nelement of the configuration key name other than the first or last\ncontains a backslash, it would not be escaped on output, but would be\ntreated as an escape sequence on input. Thus the backslash would be\nlost.\n"},{"id":"73956","messageId":"20080409141616.GB24402@shion.is.fushizen.net","threadId":"13032","inReplyTo":"47FC69CB.1080400@viscovery.net","subject":"Re: [PATCH 7/8] Use test_set_editor in t9001-send-email.sh","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-09T14:16:16Z","receivedAt":"2008-04-09T14:16:16Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"On Wed, Apr 09, 2008 at 09:01:31AM +0200, Johannes Sixt wrote:\n> Bryan Donlan schrieb:\n> > diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\n> > index 030f66c..0a65785 100755\n> > --- a/t/t9001-send-email.sh\n> > +++ b/t/t9001-send-email.sh\n> > @@ -144,10 +144,7 @@ test_expect_success 'setup fake editor' '\n> >  \tchmod +x fake-editor\n> >  '\n> >  \n> > -FAKE_EDITOR=\"$(pwd)/fake-editor\"\n> > -export FAKE_EDITOR\n> > -GIT_EDITOR='\"$FAKE_EDITOR\"'\n> > -export GIT_EDITOR\n> > +test_set_editor \"$(pwd)/fake-editor\"\n> >  \n> >  test_expect_success '--compose works' '\n> >  \tclean_fake_sendmail &&\n> \n> I'd squash this into 5/8 or 8/8. Dunno.\n\nI split it out as it's not really related to the goals of 5/8 or 8/8,\nbut is rather pure elimination of code duplication. However if it's\nconsidered better to squash it into 5/8 I'd be happy to do so.\n\nThanks,\n\nBryan\n"},{"id":"73954","messageId":"47FCD1D5.4020007@viscovery.net","threadId":"13032","inReplyTo":"20080409141334.GA24402@shion.is.fushizen.net","subject":"Re: [PATCH 2/8] config.c: Escape backslashes in section names properly","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-04-09T14:25:25Z","receivedAt":"2008-04-09T14:25:25Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Bryan Donlan schrieb:\n> On Wed, Apr 09, 2008 at 08:31:12AM +0200, Johannes Sixt wrote:\n>> Bryan Donlan schrieb:\n>>> Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n>> What is your definition of \"properly\"? Please give an example of what went\n>> wrong.\n> \n> The included patch to the test suite is an example - specifically if an\n> element of the configuration key name other than the first or last\n> contains a backslash, it would not be escaped on output, but would be\n> treated as an escape sequence on input. Thus the backslash would be\n> lost.\n\nCould you then please add this to the commit message, most importantly,\nthe last sentence?\n\n-- Hannes\n"},{"id":"73955","messageId":"20080409142808.GC24402@shion.is.fushizen.net","threadId":"13032","inReplyTo":"47FC62B6.9020304@viscovery.net","subject":"Re: [PATCH 3/8] git-send-email.perl: Handle shell metacharacters in $EDITOR properly","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-09T14:28:08Z","receivedAt":"2008-04-09T14:28:08Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"On Wed, Apr 09, 2008 at 08:31:18AM +0200, Johannes Sixt wrote:\n> Bryan Donlan schrieb:\n> > Also, update t/t9001-send-email.sh to test for this bug.\n> > \n> > Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n> \n> Your defintion of \"properly\"? I didn't immediately see what is wrong with\n> the status quo and, hence, why your fix would solve a problem.\n\nThis fixes the git-send-perl semantics for launching an editor when\n$GIT_EDITOR (or friends) contains shell metacharacters to match\nlaunch_editor() in builtin-tag.c. If we use the current approach\n(sh -c '$0 $@' \"$EDITOR\" files ...), we see it fails when $EDITOR has\nshell metacharacters:\n\n$ sh -x -c '$0 $@' \"$VISUAL\" \"foo\"\n+ \"$FAKE_EDITOR\" foo\n\"$FAKE_EDITOR\": 1: \"$FAKE_EDITOR\": not found\n\nWhereas builtin-tag.c will invoke sh -c \"$EDITOR \\\"$@\\\"\".\n\nNote that with the method git-send-perl uses currently, it's difficult\n(impossible?) to deal with a editor path that contains arbitrary shell\nmetacharacters. It's certainly impossible when the various git tools use\ndifferent semantics :)\n\nI'll amend the commit message along with the other suggested changes.\n"},{"id":"73958","messageId":"20080409143702.GD24402@shion.is.fushizen.net","threadId":"13032","inReplyTo":"47FC6863.8070704@viscovery.net","subject":"Re: [PATCH 1/8] git-rebase.sh: Fix --merge --abort failures when path contains whitespace","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-09T14:37:02Z","receivedAt":"2008-04-09T14:37:02Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"On Wed, Apr 09, 2008 at 08:55:31AM +0200, Johannes Sixt wrote:\n> Bryan Donlan schrieb:\n> > -dotest=$GIT_DIR/.dotest-merge\n> > +dotest=\"$GIT_DIR/.dotest-merge\"\n> \n> This is not strictly necessary: The RHS expression of an assignment does\n> not undergo IFS splitting; but better safe than sorry. (But note that\n> 'export foo=$bar', which is not POSIX, is *not* an assignment, and\n> different shells that support this construct treat it differently.)\n\nSince Junio asked(?) that it be removed, I'll drop it from the next rev\nof the patchset.\n\n> > +### Test that we handle strange characters properly\n> > +work_dir=\"$(pwd)/test \\\" ' \\$ \\\\ dir\"\n> \n> In effect, you modify only this test to stress-test strange characters,\n> but other tests in the test suite still run in a \"sane\" environment. IOW,\n> I don't think you should go to this extreme for this one test only. The\n> better approach would be to rename 'trash' in test-lib.sh to this strange\n> name so that all tests suffer from a challenging environment.\n\nI can do that, but it'd have to come as the last patch in the patchset,\nor it would obviously cause test failures. My goal here was to ensure\nthat the bug I fixed in the patch would be tested in an isolated manner.\n\nIf you like I can add a change to the trash directory to the next rev of\nthe patchset.\n\n> \n> > -\t\tgit reset --hard pre-rebase\n> > -\t\ttest_must_fail git rebase'\"$type\"' master &&\n> > -\t\ttest -d '$dotest' &&\n> > +\t\tgit reset --hard pre-rebase &&\n> > +\t\ttest_must_fail git rebase$type master &&\n> > +\t\ttest -d \\\"\\$dotest\\\" &&\n> \n> I could imagine that the missing && after the git reset is deliberate. Mike?\n\nI assumed that if git reset failed here we'd probably want to know :)\n\nThanks,\n\nBryan\n"},{"id":"73960","messageId":"47FCD7E8.40004@viscovery.net","threadId":"13032","inReplyTo":"20080409143702.GD24402@shion.is.fushizen.net","subject":"Re: [PATCH 1/8] git-rebase.sh: Fix --merge --abort failures when path contains whitespace","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-04-09T14:51:20Z","receivedAt":"2008-04-09T14:51:20Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Bryan Donlan schrieb:\n> On Wed, Apr 09, 2008 at 08:55:31AM +0200, Johannes Sixt wrote:\n>> Bryan Donlan schrieb:\n>>> +### Test that we handle strange characters properly\n>>> +work_dir=\"$(pwd)/test \\\" ' \\$ \\\\ dir\"\n>> In effect, you modify only this test to stress-test strange characters,\n>> but other tests in the test suite still run in a \"sane\" environment. IOW,\n>> I don't think you should go to this extreme for this one test only. The\n>> better approach would be to rename 'trash' in test-lib.sh to this strange\n>> name so that all tests suffer from a challenging environment.\n> \n> I can do that, but it'd have to come as the last patch in the patchset,\n> or it would obviously cause test failures. My goal here was to ensure\n> that the bug I fixed in the patch would be tested in an isolated manner.\n\nI for my taste could live without a test because the fix is so obvious.\nGiven that you have to prepend 'cd \"$work_dir\"' to *all* the tests, this\nreally just highlights that for the purpose of this test the name 'trash'\nof the regular test directory is just too simple ;)\n\nOf course, it's Junio's draw, and he likes to have tests for fixes that\nare submitted.\n\n> If you like I can add a change to the trash directory to the next rev of\n> the patchset.\n\nYes, why not?\n\n>>> -\t\tgit reset --hard pre-rebase\n>>> -\t\ttest_must_fail git rebase'\"$type\"' master &&\n>>> -\t\ttest -d '$dotest' &&\n>>> +\t\tgit reset --hard pre-rebase &&\n>>> +\t\ttest_must_fail git rebase$type master &&\n>>> +\t\ttest -d \\\"\\$dotest\\\" &&\n>> I could imagine that the missing && after the git reset is deliberate. Mike?\n> \n> I assumed that if git reset failed here we'd probably want to know :)\n\nOn second sight, this indeed looks just like an omission and your change\nis good.\n\n-- Hannes\n"},{"id":"73963","messageId":"20080409150246.GE24402@shion.is.fushizen.net","threadId":"13032","inReplyTo":"47FCD7E8.40004@viscovery.net","subject":"Re: [PATCH 1/8] git-rebase.sh: Fix --merge --abort failures when path contains whitespace","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-09T15:02:46Z","receivedAt":"2008-04-09T15:02:46Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"On Wed, Apr 09, 2008 at 04:51:20PM +0200, Johannes Sixt wrote:\n> Bryan Donlan schrieb:\n> \n> > If you like I can add a change to the trash directory to the next rev of\n> > the patchset.\n> \n> Yes, why not?\n\nHow exotic ought it be? I'm not entirely sure which characters are\nallowed on windows or any other non-unixes that git supports (are there\nany?)\n\nThanks,\n\nBryan\n"},{"id":"74011","messageId":"7vve2q1iqr.fsf@gitster.siamese.dyndns.org","threadId":"13032","inReplyTo":"47FC62B6.9020304@viscovery.net","subject":"Re: [PATCH 3/8] git-send-email.perl: Handle shell metacharacters in $EDITOR properly","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-10T03:39:08Z","receivedAt":"2008-04-10T03:39:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> Bryan Donlan schrieb:\n>> Also, update t/t9001-send-email.sh to test for this bug.\n>> \n>> Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n>\n> Your defintion of \"properly\"? I didn't immediately see what is wrong with\n> the status quo and, hence, why your fix would solve a problem.\n\nI agree the description of this series is a bit too sketchy.  I suspect\neven Bryan would not remember what the broken behaviour was and what's the\nnew accepted behaviour is three months from now.\n"},{"id":"74016","messageId":"47FDAF5E.6070101@viscovery.net","threadId":"13032","inReplyTo":"20080409150246.GE24402@shion.is.fushizen.net","subject":"Re: [PATCH 1/8] git-rebase.sh: Fix --merge --abort failures when path contains whitespace","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-04-10T06:10:38Z","receivedAt":"2008-04-10T06:10:38Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Bryan Donlan schrieb:\n> On Wed, Apr 09, 2008 at 04:51:20PM +0200, Johannes Sixt wrote:\n>> Bryan Donlan schrieb:\n>>\n>>> If you like I can add a change to the trash directory to the next rev of\n>>> the patchset.\n>> Yes, why not?\n> \n> How exotic ought it be? I'm not entirely sure which characters are\n> allowed on windows or any other non-unixes that git supports (are there\n> any?)\n\nWhat you had in your patch is OK: \" ' $ The backslash is also a notable\nspecial character, but it is a directory separator on Windows, so it\nshould not be in the name.\n\n-- Hannes\n"},{"id":"74019","messageId":"47FDB85F.9070503@viscovery.net","threadId":"13032","inReplyTo":"20080410063028.GA12562@shion.is.fushizen.net","subject":"Re: [PATCH 8/8] Fix tests breaking when checkout path contains shell metacharacters","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-04-10T06:49:03Z","receivedAt":"2008-04-10T06:49:03Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Bryan Donlan schrieb:\n> (did you mean to send the original reply to the list as well? not ccing for\n>  now, feel free to re-send/forward to the list if you like)\n\nSorry, yes, I hit the wrong button. I'm lazy again and simply resend this\nreply with the complete Cc list, with everything quoted.\n\n> On Wed, Apr 09, 2008 at 09:01:12AM +0200, Johannes Sixt wrote:\n>> Bryan Donlan schrieb:\n>>> -\t\tGIT_WORK_TREE=$(pwd) GIT_DIR=git-dir-wt-1.git git init\n>>> +\t\tGIT_WORK_TREE=\"$(pwd)\" GIT_DIR=git-dir-wt-1.git git init\n>> This ...\n>>\n>>> -HERE=`pwd`\n>>> +HERE=\"$(pwd)\"\n>> ... and this and a lot of similar cases shouldn't be required: The RHS of\n>> an assignment does not undergo word-splitting.\n> \n> Will fix.\n> \n>>> -export GIT_DIR=$(pwd)/repo.git\n>>> -export GIT_CONFIG=$GIT_DIR/config\n>>> +export GIT_DIR=\"$(pwd)/repo.git\"\n>>> +export GIT_CONFIG=\"$GIT_DIR/config\"\n>> This, OTOH, is not an assignment, and the change is to the better. But not\n>> all shells support export with assignment. Hence this should be changed to\n>> the form\n>>\n>> \tGIT_DIR=$(pwd)/repo.git\n>> \tGIT_CONFIG=$GIT_DIR/config\n>> \texport GIT_DIR GIT_CONFIG\n>>\n>> (and similar cases at other places).\n> \n> I'll break these bits out into another patch in the sequence and fix.\n> \n>>>  test_expect_success  \".rev_db auto-converted to .rev_map.UUID\" \"\n>>>  \tgit-svn fetch -i trunk &&\n>>> -\ttest -z \\\"\\$(ls $GIT_DIR/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n>>> -\texpect=\\\"\\$(ls $GIT_DIR/svn/trunk/.rev_map.*)\\\" &&\n>>> +\ttest -z \\\"\\$(ls \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n>>> +\texpect=\\\"\\$(ls \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_map.*)\\\" &&\n>>>  \ttest -n \\\"\\$expect\\\" &&\n>>> -\trev_db=\\$(echo \\$expect | sed -e 's,_map,_db,') &&\n>>> -\tconvert_to_rev_db \\$expect \\$rev_db &&\n>>> -\trm -f \\$expect &&\n>>> -\ttest -f \\$rev_db &&\n>>> +\trev_db=\\\"\\$(echo \\$expect | sed -e 's,_map,_db,')\\\" &&\n>>> +\tconvert_to_rev_db \\\"\\$expect\\\" \\\"\\$rev_db\\\" &&\n>>> +\trm -f \\\"\\$expect\\\" &&\n>>> +\ttest -f \\\"\\$rev_db\\\" &&\n>>>  \tgit-svn fetch -i trunk &&\n>>> -\ttest -z \\\"\\$(ls $GIT_DIR/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n>>> -\ttest ! -e $GIT_DIR/svn/trunk/.rev_db &&\n>>> -\ttest -f \\$expect\n>>> +\ttest -z \\\"\\$(ls \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n>>> +\ttest ! -e \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_db &&\n>>> +\ttest -f \\\"\\$expect\\\"\n>>>  \t\"\n>> While looking at this test: Wouldn't it be easier to just place the whole\n>> thing (and probably similar cases, too) in single-quotes?\n> \n> To be honest, I fixed all the git-svn tests with a suitably clever vim s///\n> expression, so at the time this way was actually easier :)\n\nFair enough. If you still have the statement in you vim history, it's\nworth quoting in the commit message. It's another piece of information\nthat helps reviewing.\n\n> (Essentially all of the git-svn tests were broken, and it was a little\n>  annoying to fix them all by hand... though of course I verified the\n>  results)\n\n-- Hannes\n"},{"id":"74021","messageId":"1207810216-27871-1-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"cover.1207702130.git.bdonlan@fushizen.net","subject":"[PATCH v2 00/10] Fix git's test suite to pass when the path contains spaces","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-10T06:50:06Z","receivedAt":"2008-04-10T06:50:06Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"This patch series fixes bugs in git and git's testsuite to allow all tests\nto pass when the working directory contains whitespace and/or shell\nmetacharacters.\n\nThe first three patches in this series fix bugs in git itself that were\nuncovered in the process of fixing the test suite. Each contains additional\ntests and/or updates to existing tests to exercise the bug in question.\n\nPatches 4 and 5 set up an abstraction for safe handling of editor variables\nin tests when we have odd paths, and 6-8 fix bugs in the test suite itself.\nPatch 9 cleans up some instances of the unportable export FOO=bar construct\nin the test suite; and 10 arranges for the test suite to always run with the\ntrash directory name containing various metacharacters, to help prevent\nregressions in the future.\n\nSignifigant changes since v1:\n  * Rebase against master\n  * Drop some unnecessary quotation additions\n  * Use \"$@\" not $@ in editor invocations in the fix to git-send-email, to\n    match builtin-tag.c\n  * Be more verbose in the config.c and git-send-email.perl patch commit\n    messages\n  * Rename 't/trash' to 't/trash directory' to try to trip up more bugs in\n    the future\n  * Add a patch to convert all export FOO=bar to FOO=bar; export FOO in t/*.sh\n  * Noted why t/t7505-prepare-commit-msg-hook.sh isn't using test_set_editor\n    in a comment.\n  * Clarified the purpose and implementation of test_set_editor in a comment.\n\nThis series is also available as a git branch:\n\n  git pull git://repo.or.cz/git/bdonlan.git tags/wst-submit2\n\nBryan Donlan (10):\n  git-rebase.sh: Fix --merge --abort failures when path contains\n    whitespace\n  config.c: Escape backslashes in section names properly\n  git-send-email.perl: Handle shell metacharacters in $EDITOR properly\n  test-lib.sh: Add a test_set_editor function to safely set $VISUAL\n  Use test_set_editor in t9001-send-email.sh\n  test-lib.sh: Fix some missing path quoting\n  lib-git-svn.sh: Fix quoting issues with paths containing shell\n    metacharacters\n  Don't use the export NAME=value form in the test scripts.\n  Fix tests breaking when checkout path contains shell metacharacters\n  Rename the test trash directory to contain shell metacharacters.\n\n config.c                                      |    2 +-\n git-rebase.sh                                 |    2 +-\n git-send-email.perl                           |    2 +-\n t/.gitignore                                  |    2 +-\n t/lib-git-svn.sh                              |    3 +-\n t/lib-httpd.sh                                |    3 +-\n t/t0000-basic.sh                              |    4 +-\n t/t1020-subdirectory.sh                       |   22 +++++-----\n t/t1303-wacky-config.sh                       |    6 +++\n t/t1500-rev-parse.sh                          |    9 ++--\n t/t1501-worktree.sh                           |   34 ++++++++-------\n t/t3050-subprojects-fetch.sh                  |    2 +-\n t/t3400-rebase.sh                             |    3 +-\n t/t3404-rebase-interactive.sh                 |    3 +-\n t/t3407-rebase-abort.sh                       |   55 ++++++++++++++----------\n t/t3500-cherry.sh                             |    3 +-\n t/t5500-fetch-pack.sh                         |    4 +-\n t/t5512-ls-remote.sh                          |    2 +-\n t/t5516-fetch-push.sh                         |    4 +-\n t/t5700-clone-reference.sh                    |    2 +-\n t/t5710-info-alternate.sh                     |    2 +-\n t/t6000lib.sh                                 |    9 +++-\n t/t6010-merge-base.sh                         |    9 ++--\n t/t6200-fmt-merge-msg.sh                      |    6 +-\n t/t7003-filter-branch.sh                      |    2 +-\n t/t7004-tag.sh                                |    3 +-\n t/t7010-setup.sh                              |    2 +-\n t/t7300-clean.sh                              |    2 +-\n t/t7501-commit.sh                             |    8 ++--\n t/t7504-commit-msg-hook.sh                    |   23 ++++++-----\n t/t7505-prepare-commit-msg-hook.sh            |   17 +++++---\n t/t9001-send-email.sh                         |    5 +-\n t/t9100-git-svn-basic.sh                      |   54 ++++++++++++------------\n t/t9101-git-svn-props.sh                      |    6 +-\n t/t9102-git-svn-deep-rmdir.sh                 |    6 +-\n t/t9103-git-svn-tracked-directory-removed.sh  |   30 +++++++-------\n t/t9104-git-svn-follow-parent.sh              |   50 +++++++++++-----------\n t/t9105-git-svn-commit-diff.sh                |   12 +++---\n t/t9106-git-svn-commit-diff-clobber.sh        |   14 +++---\n t/t9106-git-svn-dcommit-clobber-series.sh     |    6 +-\n t/t9107-git-svn-migrate.sh                    |   48 +++++++++++-----------\n t/t9108-git-svn-glob.sh                       |    8 ++--\n t/t9110-git-svn-use-svm-props.sh              |    8 ++--\n t/t9111-git-svn-use-svnsync-props.sh          |    8 ++--\n t/t9112-git-svn-md5less-file.sh               |    4 +-\n t/t9113-git-svn-dcommit-new-file.sh           |    6 +-\n t/t9114-git-svn-dcommit-merge.sh              |    4 +-\n t/t9115-git-svn-dcommit-funky-renames.sh      |    4 +-\n t/t9116-git-svn-log.sh                        |    4 +-\n t/t9117-git-svn-init-clone.sh                 |   10 ++--\n t/t9118-git-svn-funky-branch-names.sh         |   12 +++---\n t/t9120-git-svn-clone-with-percent-escapes.sh |    2 +-\n t/t9121-git-svn-fetch-renamed-dir.sh          |   12 +++---\n t/t9500-gitweb-standalone-no-errors.sh        |   25 ++++++-----\n t/test-lib.sh                                 |   22 +++++++++-\n 55 files changed, 331 insertions(+), 279 deletions(-)\n"},{"id":"74024","messageId":"1207810216-27871-2-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207810216-27871-1-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v2 01/10] git-rebase.sh: Fix --merge --abort failures when path contains whitespace","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-10T06:50:07Z","receivedAt":"2008-04-10T06:50:07Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"Also update t/t3407-rebase-abort.sh to exercise the bug\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n git-rebase.sh           |    2 +-\n t/t3407-rebase-abort.sh |   55 +++++++++++++++++++++++++++-------------------\n 2 files changed, 33 insertions(+), 24 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 9b13b83..c43afe5 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -214,7 +214,7 @@ do\n \t\telse\n \t\t\tdie \"No rebase in progress?\"\n \t\tfi\n-\t\tgit reset --hard $(cat $dotest/orig-head)\n+\t\tgit reset --hard $(cat \"$dotest/orig-head\")\n \t\trm -r \"$dotest\"\n \t\texit\n \t\t;;\ndiff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh\nindex 37944c3..396a354 100755\n--- a/t/t3407-rebase-abort.sh\n+++ b/t/t3407-rebase-abort.sh\n@@ -4,7 +4,13 @@ test_description='git rebase --abort tests'\n \n . ./test-lib.sh\n \n+### Test that we handle strange characters properly\n+work_dir=\"$(pwd)/test \\\" ' \\$ \\\\ dir\"\n+\n test_expect_success setup '\n+\tmkdir -p \"$work_dir\" &&\n+\tcd \"$work_dir\" &&\n+\tgit init &&\n \techo a > a &&\n \tgit add a &&\n \tgit commit -m a &&\n@@ -27,42 +33,45 @@ testrebase() {\n \ttype=$1\n \tdotest=$2\n \n-\ttest_expect_success \"rebase$type --abort\" '\n+\ttest_expect_success \"rebase$type --abort\" \"\n+\t\tcd \\\"\\$work_dir\\\" &&\n \t\t# Clean up the state from the previous one\n-\t\tgit reset --hard pre-rebase\n-\t\ttest_must_fail git rebase'\"$type\"' master &&\n-\t\ttest -d '$dotest' &&\n+\t\tgit reset --hard pre-rebase &&\n+\t\ttest_must_fail git rebase$type master &&\n+\t\ttest -d \\\"\\$dotest\\\" &&\n \t\tgit rebase --abort &&\n-\t\ttest $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&\n-\t\ttest ! -d '$dotest'\n-\t'\n+\t\ttest \\$(git rev-parse to-rebase) = \\$(git rev-parse pre-rebase) &&\n+\t\ttest ! -d \\\"\\$dotest\\\"\n+\t\"\n \n-\ttest_expect_success \"rebase$type --abort after --skip\" '\n+\ttest_expect_success \"rebase$type --abort after --skip\" \"\n+\t\tcd \\\"\\$work_dir\\\" &&\n \t\t# Clean up the state from the previous one\n-\t\tgit reset --hard pre-rebase\n-\t\ttest_must_fail git rebase'\"$type\"' master &&\n-\t\ttest -d '$dotest' &&\n+\t\tgit reset --hard pre-rebase &&\n+\t\ttest_must_fail git rebase$type master &&\n+\t\ttest -d \\\"\\$dotest\\\" &&\n \t\ttest_must_fail git rebase --skip &&\n-\t\ttest $(git rev-parse HEAD) = $(git rev-parse master) &&\n+\t\ttest \\$(git rev-parse HEAD) = \\$(git rev-parse master) &&\n \t\tgit-rebase --abort &&\n-\t\ttest $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&\n-\t\ttest ! -d '$dotest'\n-\t'\n+\t\ttest \\$(git rev-parse to-rebase) = \\$(git rev-parse pre-rebase) &&\n+\t\ttest ! -d \\\"\\$dotest\\\"\n+\t\"\n \n-\ttest_expect_success \"rebase$type --abort after --continue\" '\n+\ttest_expect_success \"rebase$type --abort after --continue\" \"\n+\t\tcd \\\"\\$work_dir\\\" &&\n \t\t# Clean up the state from the previous one\n-\t\tgit reset --hard pre-rebase\n-\t\ttest_must_fail git rebase'\"$type\"' master &&\n-\t\ttest -d '$dotest' &&\n+\t\tgit reset --hard pre-rebase &&\n+\t\ttest_must_fail git rebase$type master &&\n+\t\ttest -d \\\"\\$dotest\\\" &&\n \t\techo c > a &&\n \t\techo d >> a &&\n \t\tgit add a &&\n \t\ttest_must_fail git rebase --continue &&\n-\t\ttest $(git rev-parse HEAD) != $(git rev-parse master) &&\n+\t\ttest \\$(git rev-parse HEAD) != \\$(git rev-parse master) &&\n \t\tgit rebase --abort &&\n-\t\ttest $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&\n-\t\ttest ! -d '$dotest'\n-\t'\n+\t\ttest \\$(git rev-parse to-rebase) = \\$(git rev-parse pre-rebase) &&\n+\t\ttest ! -d \\\"\\$dotest\\\"\n+\t\"\n }\n \n testrebase \"\" .dotest\n-- \n1.5.5.33.gc0a39.dirty\n"},{"id":"74023","messageId":"1207810216-27871-3-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207810216-27871-2-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v2 02/10] config.c: Escape backslashes in section names properly","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-10T06:50:08Z","receivedAt":"2008-04-10T06:50:08Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"If an element of the configuration key name other than the first or last\ncontains a backslash, it is not escaped on output, but is treated as an escape\nsequence on input. Thus, the backslash is lost when re-loading the\nconfiguration.\n\nThis patch corrects this by having backslashes escaped properly, and\nintroduces a new test for this bug.\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n config.c                |    2 +-\n t/t1303-wacky-config.sh |    6 ++++++\n 2 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/config.c b/config.c\nindex 0624494..6c07245 100644\n--- a/config.c\n+++ b/config.c\n@@ -672,7 +672,7 @@ static int store_write_section(int fd, const char* key)\n \tif (dot) {\n \t\tstrbuf_addf(&sb, \"[%.*s \\\"\", (int)(dot - key), key);\n \t\tfor (i = dot - key + 1; i < store.baselen; i++) {\n-\t\t\tif (key[i] == '\"')\n+\t\t\tif (key[i] == '\"' || key[i] == '\\\\')\n \t\t\t\tstrbuf_addch(&sb, '\\\\');\n \t\t\tstrbuf_addch(&sb, key[i]);\n \t\t}\ndiff --git a/t/t1303-wacky-config.sh b/t/t1303-wacky-config.sh\nindex 99985dc..f366b53 100755\n--- a/t/t1303-wacky-config.sh\n+++ b/t/t1303-wacky-config.sh\n@@ -34,4 +34,10 @@ test_expect_success 'add key in different section' '\n \tcheck section2.key bar\n '\n \n+SECTION=\"test.q\\\"s\\\\sq'sp e.key\"\n+test_expect_success 'make sure git-config escapes section names properly' '\n+\tgit config \"$SECTION\" bar &&\n+\tcheck \"$SECTION\" bar\n+'\n+\n test_done\n-- \n1.5.5.33.gc0a39.dirty\n"},{"id":"74026","messageId":"1207810216-27871-4-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207810216-27871-3-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v2 03/10] git-send-email.perl: Handle shell metacharacters in $EDITOR properly","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-10T06:50:09Z","receivedAt":"2008-04-10T06:50:09Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"This fixes the git-send-perl semantics for launching an editor when\n$GIT_EDITOR (or friends) contains shell metacharacters to match\nlaunch_editor() in builtin-tag.c. If we use the current approach\n(sh -c '$0 $@' \"$EDITOR\" files ...), we see it fails when $EDITOR has\nshell metacharacters:\n\n$ sh -x -c '$0 $@' \"$VISUAL\" \"foo\"\n+ \"$FAKE_EDITOR\" foo\n\"$FAKE_EDITOR\": 1: \"$FAKE_EDITOR\": not found\n\nWhereas builtin-tag.c will invoke sh -c \"$EDITOR \\\"$@\\\"\".\n\nThus, this patch changes git-send-email.perl to use the same method as the\nC utilities, and additionally updates t/t9001-send-email.sh to test for this bug.\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n git-send-email.perl   |    2 +-\n t/t9001-send-email.sh |    8 ++++++--\n 2 files changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 9e568bf..b502396 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -512,7 +512,7 @@ EOT\n \tclose(C);\n \n \tmy $editor = $ENV{GIT_EDITOR} || Git::config(@repo, \"core.editor\") || $ENV{VISUAL} || $ENV{EDITOR} || \"vi\";\n-\tsystem('sh', '-c', '$0 $@', $editor, $compose_filename);\n+\tsystem('sh', '-c', $editor.' \"$@\"', $editor, $compose_filename);\n \n \topen(C2,\">\",$compose_filename . \".final\")\n \t\tor die \"Failed to open $compose_filename.final : \" . $!;\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex c0973b4..030f66c 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -139,15 +139,19 @@ test_expect_success 'Valid In-Reply-To when prompting' '\n \n test_expect_success 'setup fake editor' '\n \t(echo \"#!/bin/sh\" &&\n-\t echo \"echo fake edit >>\\$1\"\n+\t echo \"echo fake edit >>\\\"\\$1\\\"\"\n \t) >fake-editor &&\n \tchmod +x fake-editor\n '\n \n+FAKE_EDITOR=\"$(pwd)/fake-editor\"\n+export FAKE_EDITOR\n+GIT_EDITOR='\"$FAKE_EDITOR\"'\n+export GIT_EDITOR\n+\n test_expect_success '--compose works' '\n \tclean_fake_sendmail &&\n \techo y | \\\n-\t\tGIT_EDITOR=$(pwd)/fake-editor \\\n \t\tGIT_SEND_EMAIL_NOTTY=1 \\\n \t\tgit send-email \\\n \t\t--compose --subject foo \\\n-- \n1.5.5.33.gc0a39.dirty\n"},{"id":"74028","messageId":"1207810216-27871-5-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207810216-27871-4-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v2 04/10] test-lib.sh: Add a test_set_editor function to safely set $VISUAL","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-10T06:50:10Z","receivedAt":"2008-04-10T06:50:10Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"In particular, this function correctly handles cases where the pwd contains\nspaces, quotes, and other troublesome metacharacters.\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/test-lib.sh |   16 ++++++++++++++++\n 1 files changed, 16 insertions(+), 0 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 7c2a8ba..d7ad13b 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -160,6 +160,22 @@ die () {\n \n trap 'die' exit\n \n+# The semantics of the editor variables are that of invoking\n+# sh -c \"$EDITOR \\\"$@\\\"\" files ...\n+#\n+# If our trash directory contains shell metacharacters, they will be\n+# interpreted if we just set $EDITOR directly, so do a little dance with\n+# environment variables to work around this.\n+#\n+# In particular, quoting isn't enough, as the path may contain the same quote\n+# that we're using. \n+test_set_editor () {\n+\tFAKE_EDITOR=\"$1\"\n+\texport FAKE_EDITOR\n+\tVISUAL='\"$FAKE_EDITOR\"'\n+\texport VISUAL\n+}\n+\n test_tick () {\n \tif test -z \"${test_tick+set}\"\n \tthen\n-- \n1.5.5.33.gc0a39.dirty\n"},{"id":"74027","messageId":"1207810216-27871-6-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207810216-27871-5-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v2 05/10] Use test_set_editor in t9001-send-email.sh","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-10T06:50:11Z","receivedAt":"2008-04-10T06:50:11Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/t9001-send-email.sh |    5 +----\n 1 files changed, 1 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex 030f66c..0a65785 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -144,10 +144,7 @@ test_expect_success 'setup fake editor' '\n \tchmod +x fake-editor\n '\n \n-FAKE_EDITOR=\"$(pwd)/fake-editor\"\n-export FAKE_EDITOR\n-GIT_EDITOR='\"$FAKE_EDITOR\"'\n-export GIT_EDITOR\n+test_set_editor \"$(pwd)/fake-editor\"\n \n test_expect_success '--compose works' '\n \tclean_fake_sendmail &&\n-- \n1.5.5.33.gc0a39.dirty\n"},{"id":"74025","messageId":"1207810216-27871-7-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207810216-27871-6-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v2 06/10] test-lib.sh: Fix some missing path quoting","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-10T06:50:12Z","receivedAt":"2008-04-10T06:50:12Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/test-lib.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex d7ad13b..04e098b 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -345,7 +345,7 @@ test_create_repo () {\n \trepo=\"$1\"\n \tmkdir \"$repo\"\n \tcd \"$repo\" || error \"Cannot setup test environment\"\n-\t\"$GIT_EXEC_PATH/git\" init --template=$GIT_EXEC_PATH/templates/blt/ >/dev/null 2>&1 ||\n+\t\"$GIT_EXEC_PATH/git\" init \"--template=$GIT_EXEC_PATH/templates/blt/\" >/dev/null 2>&1 ||\n \terror \"cannot run git init -- have you built things yet?\"\n \tmv .git/hooks .git/hooks-disabled\n \tcd \"$owd\"\n-- \n1.5.5.33.gc0a39.dirty\n"},{"id":"74020","messageId":"1207810216-27871-8-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207810216-27871-7-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v2 07/10] lib-git-svn.sh: Fix quoting issues with paths containing shell metacharacters","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-10T06:50:13Z","receivedAt":"2008-04-10T06:50:13Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/lib-git-svn.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex 9decd2e..445df78 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -20,12 +20,13 @@ then\n fi\n \n svnrepo=$PWD/svnrepo\n+export svnrepo\n \n perl -w -e \"\n use SVN::Core;\n use SVN::Repos;\n \\$SVN::Core::VERSION gt '1.1.0' or exit(42);\n-system(qw/svnadmin create --fs-type fsfs/, '$svnrepo') == 0 or exit(41);\n+system(qw/svnadmin create --fs-type fsfs/, \\$ENV{svnrepo}) == 0 or exit(41);\n \" >&3 2>&4\n x=$?\n if test $x -ne 0\n-- \n1.5.5.33.gc0a39.dirty\n"},{"id":"74029","messageId":"1207810216-27871-9-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207810216-27871-8-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v2 08/10] Don't use the export NAME=value form in the test scripts.","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-10T06:50:14Z","receivedAt":"2008-04-10T06:50:14Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"This form is not portable across all shells, so replace instances of:\n\n  export FOO=bar\n\nwith:\n\n  FOO=bar\n  export FOO\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/lib-httpd.sh                         |    3 +-\n t/t1500-rev-parse.sh                   |    9 ++++---\n t/t1501-worktree.sh                    |   34 ++++++++++++++++---------------\n t/t3400-rebase.sh                      |    3 +-\n t/t3500-cherry.sh                      |    3 +-\n t/t5500-fetch-pack.sh                  |    2 +-\n t/t6000lib.sh                          |    9 +++++--\n t/t6010-merge-base.sh                  |    9 ++++---\n t/t7004-tag.sh                         |    3 +-\n t/t9500-gitweb-standalone-no-errors.sh |   16 ++++++++------\n 10 files changed, 52 insertions(+), 39 deletions(-)\n\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nindex 7f206c5..a5c4436 100644\n--- a/t/lib-httpd.sh\n+++ b/t/lib-httpd.sh\n@@ -61,7 +61,8 @@ prepare_httpd() {\n \t\t\t-new -x509 -nodes \\\n \t\t\t-out $HTTPD_ROOT_PATH/httpd.pem \\\n \t\t\t-keyout $HTTPD_ROOT_PATH/httpd.pem\n-\t\texport GIT_SSL_NO_VERIFY=t\n+\t\tGIT_SSL_NO_VERIFY=t\n+\t\texport GIT_SSL_NO_VERIFY\n \t\tHTTPD_PARA=\"$HTTPD_PARA -DSSL\"\n \telse\n \t\tHTTPD_URL=http://127.0.0.1:$LIB_HTTPD_PORT\ndiff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh\nindex 38a2bf0..85da4ca 100755\n--- a/t/t1500-rev-parse.sh\n+++ b/t/t1500-rev-parse.sh\n@@ -51,8 +51,9 @@ test_rev_parse 'core.bare undefined' false false true\n \n mkdir work || exit 1\n cd work || exit 1\n-export GIT_DIR=../.git\n-export GIT_CONFIG=\"$(pwd)\"/../.git/config\n+GIT_DIR=../.git\n+GIT_CONFIG=\"$(pwd)\"/../.git/config\n+export GIT_DIR GIT_CONFIG\n \n git config core.bare false\n test_rev_parse 'GIT_DIR=../.git, core.bare = false' false false true ''\n@@ -64,8 +65,8 @@ git config --unset core.bare\n test_rev_parse 'GIT_DIR=../.git, core.bare undefined' false false true ''\n \n mv ../.git ../repo.git || exit 1\n-export GIT_DIR=../repo.git\n-export GIT_CONFIG=\"$(pwd)\"/../repo.git/config\n+GIT_DIR=../repo.git\n+GIT_CONFIG=\"$(pwd)\"/../repo.git/config\n \n git config core.bare false\n test_rev_parse 'GIT_DIR=../repo.git, core.bare = false' false false true ''\ndiff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh\nindex 7ee3820..2ee88d8 100755\n--- a/t/t1501-worktree.sh\n+++ b/t/t1501-worktree.sh\n@@ -32,24 +32,25 @@ mkdir -p work/sub/dir || exit 1\n mv .git repo.git || exit 1\n \n say \"core.worktree = relative path\"\n-export GIT_DIR=repo.git\n-export GIT_CONFIG=\"$(pwd)\"/$GIT_DIR/config\n+GIT_DIR=repo.git\n+GIT_CONFIG=\"$(pwd)\"/$GIT_DIR/config\n+export GIT_DIR GIT_CONFIG\n unset GIT_WORK_TREE\n git config core.worktree ../work\n test_rev_parse 'outside'      false false false\n cd work || exit 1\n-export GIT_DIR=../repo.git\n-export GIT_CONFIG=\"$(pwd)\"/$GIT_DIR/config\n+GIT_DIR=../repo.git\n+GIT_CONFIG=\"$(pwd)\"/$GIT_DIR/config\n test_rev_parse 'inside'       false false true ''\n cd sub/dir || exit 1\n-export GIT_DIR=../../../repo.git\n-export GIT_CONFIG=\"$(pwd)\"/$GIT_DIR/config\n+GIT_DIR=../../../repo.git\n+GIT_CONFIG=\"$(pwd)\"/$GIT_DIR/config\n test_rev_parse 'subdirectory' false false true sub/dir/\n cd ../../.. || exit 1\n \n say \"core.worktree = absolute path\"\n-export GIT_DIR=$(pwd)/repo.git\n-export GIT_CONFIG=$GIT_DIR/config\n+GIT_DIR=$(pwd)/repo.git\n+GIT_CONFIG=$GIT_DIR/config\n git config core.worktree \"$(pwd)/work\"\n test_rev_parse 'outside'      false false false\n cd work || exit 1\n@@ -59,25 +60,26 @@ test_rev_parse 'subdirectory' false false true sub/dir/\n cd ../../.. || exit 1\n \n say \"GIT_WORK_TREE=relative path (override core.worktree)\"\n-export GIT_DIR=$(pwd)/repo.git\n-export GIT_CONFIG=$GIT_DIR/config\n+GIT_DIR=$(pwd)/repo.git\n+GIT_CONFIG=$GIT_DIR/config\n git config core.worktree non-existent\n-export GIT_WORK_TREE=work\n+GIT_WORK_TREE=work\n+export GIT_WORK_TREE\n test_rev_parse 'outside'      false false false\n cd work || exit 1\n-export GIT_WORK_TREE=.\n+GIT_WORK_TREE=.\n test_rev_parse 'inside'       false false true ''\n cd sub/dir || exit 1\n-export GIT_WORK_TREE=../..\n+GIT_WORK_TREE=../..\n test_rev_parse 'subdirectory' false false true sub/dir/\n cd ../../.. || exit 1\n \n mv work repo.git/work\n \n say \"GIT_WORK_TREE=absolute path, work tree below git dir\"\n-export GIT_DIR=$(pwd)/repo.git\n-export GIT_CONFIG=$GIT_DIR/config\n-export GIT_WORK_TREE=$(pwd)/repo.git/work\n+GIT_DIR=$(pwd)/repo.git\n+GIT_CONFIG=$GIT_DIR/config\n+GIT_WORK_TREE=$(pwd)/repo.git/work\n test_rev_parse 'outside'              false false false\n cd repo.git || exit 1\n test_rev_parse 'in repo.git'              false true  false\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 496f4ec..10d7449 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -9,7 +9,8 @@ This test runs git rebase and checks that the author information is not lost.\n '\n . ./test-lib.sh\n \n-export GIT_AUTHOR_EMAIL=bogus_email_address\n+GIT_AUTHOR_EMAIL=bogus_email_address\n+export GIT_AUTHOR_EMAIL\n \n test_expect_success \\\n     'prepare repository with topic branches' \\\ndiff --git a/t/t3500-cherry.sh b/t/t3500-cherry.sh\nindex d0a440f..4911c48 100755\n--- a/t/t3500-cherry.sh\n+++ b/t/t3500-cherry.sh\n@@ -10,7 +10,8 @@ checks that git cherry only returns the second patch in the local branch\n '\n . ./test-lib.sh\n \n-export GIT_AUTHOR_EMAIL=bogus_email_address\n+GIT_AUTHOR_EMAIL=bogus_email_address\n+export GIT_AUTHOR_EMAIL\n \n test_expect_success \\\n     'prepare repository with topic branch, and check cherry finds the 2 patches from there' \\\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 788b4a5..1700d07 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -31,7 +31,7 @@ add () {\n \tsec=$(($sec+1))\n \tcommit=$(echo \"$text\" | GIT_AUTHOR_DATE=$sec \\\n \t\tgit commit-tree $tree $parents 2>>log2.txt)\n-\texport $name=$commit\n+\teval \"$name=$commit; export $name\"\n \techo $commit > .git/refs/heads/$branch\n \teval ${branch}TIP=$commit\n }\ndiff --git a/t/t6000lib.sh b/t/t6000lib.sh\nindex c0baaa5..f55627b 100755\n--- a/t/t6000lib.sh\n+++ b/t/t6000lib.sh\n@@ -49,13 +49,15 @@ as_author()\n \tshift 1\n         _save=$GIT_AUTHOR_EMAIL\n \n-\texport GIT_AUTHOR_EMAIL=\"$_author\"\n+\tGIT_AUTHOR_EMAIL=\"$_author\"\n+\texport GIT_AUTHOR_EMAIL\n \t\"$@\"\n \tif test -z \"$_save\"\n \tthen\n \t\tunset GIT_AUTHOR_EMAIL\n \telse\n-\t\texport GIT_AUTHOR_EMAIL=\"$_save\"\n+\t\tGIT_AUTHOR_EMAIL=\"$_save\"\n+\t\texport GIT_AUTHOR_EMAIL\n \tfi\n }\n \n@@ -69,7 +71,8 @@ on_committer_date()\n {\n     _date=$1\n     shift 1\n-    export GIT_COMMITTER_DATE=\"$_date\"\n+    GIT_COMMITTER_DATE=\"$_date\"\n+    export GIT_COMMITTER_DATE\n     \"$@\"\n     unset GIT_COMMITTER_DATE\n }\ndiff --git a/t/t6010-merge-base.sh b/t/t6010-merge-base.sh\nindex 96f3d35..b6e57b2 100755\n--- a/t/t6010-merge-base.sh\n+++ b/t/t6010-merge-base.sh\n@@ -13,10 +13,11 @@ T=$(git write-tree)\n M=1130000000\n Z=+0000\n \n-export GIT_COMMITTER_EMAIL=git@comm.iter.xz\n-export GIT_COMMITTER_NAME='C O Mmiter'\n-export GIT_AUTHOR_NAME='A U Thor'\n-export GIT_AUTHOR_EMAIL=git@au.thor.xz\n+GIT_COMMITTER_EMAIL=git@comm.iter.xz\n+GIT_COMMITTER_NAME='C O Mmiter'\n+GIT_AUTHOR_NAME='A U Thor'\n+GIT_AUTHOR_EMAIL=git@au.thor.xz\n+export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL\n \n doit() {\n \tOFFSET=$1; shift\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 1a7141e..2dcee7c 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -626,7 +626,8 @@ esac\n \n cp -R ../t7004 ./gpghome\n chmod 0700 gpghome\n-export GNUPGHOME=\"$(pwd)/gpghome\"\n+GNUPGHOME=\"$(pwd)/gpghome\"\n+export GNUPGHOME\n \n get_tag_header signed-tag $commit commit $time >expect\n echo 'A signed tag message' >>expect\ndiff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\nindex 796cd7d..e7b911e 100755\n--- a/t/t9500-gitweb-standalone-no-errors.sh\n+++ b/t/t9500-gitweb-standalone-no-errors.sh\n@@ -39,13 +39,15 @@ EOF\n }\n \n gitweb_run () {\n-\texport GATEWAY_INTERFACE=\"CGI/1.1\"\n-\texport HTTP_ACCEPT=\"*/*\"\n-\texport REQUEST_METHOD=\"GET\"\n-\texport QUERY_STRING=\"\"$1\"\"\n-\texport PATH_INFO=\"\"$2\"\"\n-\n-\texport GITWEB_CONFIG=$(pwd)/gitweb_config.perl\n+\tGATEWAY_INTERFACE=\"CGI/1.1\"\n+\tHTTP_ACCEPT=\"*/*\"\n+\tREQUEST_METHOD=\"GET\"\n+\tQUERY_STRING=\"\"$1\"\"\n+\tPATH_INFO=\"\"$2\"\"\n+\texport GATEWAY_INTERFACE HTTP_ACCEPT REQUEST_METHOD QUERY_STRING PATH_INFO\n+\n+\tGITWEB_CONFIG=$(pwd)/gitweb_config.perl\n+\texport GITWEB_CONFIG\n \n \t# some of git commands write to STDERR on error, but this is not\n \t# written to web server logs, so we are not interested in that:\n-- \n1.5.5.33.gc0a39.dirty\n"},{"id":"74030","messageId":"1207810216-27871-10-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207810216-27871-9-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v2 09/10] Fix tests breaking when checkout path contains shell metacharacters","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-10T06:50:15Z","receivedAt":"2008-04-10T06:50:15Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"This fixes the remainder of the issues where the test script itself is at\nfault for failing when the git checkout path contains whitespace or other\nshell metacharacters.\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/t0000-basic.sh                              |    4 +-\n t/t1020-subdirectory.sh                       |   22 +++++-----\n t/t3050-subprojects-fetch.sh                  |    2 +-\n t/t3404-rebase-interactive.sh                 |    3 +-\n t/t5500-fetch-pack.sh                         |    2 +-\n t/t5512-ls-remote.sh                          |    2 +-\n t/t5516-fetch-push.sh                         |    4 +-\n t/t5700-clone-reference.sh                    |    2 +-\n t/t5710-info-alternate.sh                     |    2 +-\n t/t7003-filter-branch.sh                      |    2 +-\n t/t7010-setup.sh                              |    2 +-\n t/t7300-clean.sh                              |    2 +-\n t/t7501-commit.sh                             |    8 ++--\n t/t7504-commit-msg-hook.sh                    |   23 ++++++-----\n t/t7505-prepare-commit-msg-hook.sh            |   17 +++++---\n t/t9100-git-svn-basic.sh                      |   54 ++++++++++++------------\n t/t9101-git-svn-props.sh                      |    6 +-\n t/t9102-git-svn-deep-rmdir.sh                 |    6 +-\n t/t9103-git-svn-tracked-directory-removed.sh  |   30 +++++++-------\n t/t9104-git-svn-follow-parent.sh              |   50 +++++++++++-----------\n t/t9105-git-svn-commit-diff.sh                |   12 +++---\n t/t9106-git-svn-commit-diff-clobber.sh        |   14 +++---\n t/t9106-git-svn-dcommit-clobber-series.sh     |    6 +-\n t/t9107-git-svn-migrate.sh                    |   48 +++++++++++-----------\n t/t9108-git-svn-glob.sh                       |    8 ++--\n t/t9110-git-svn-use-svm-props.sh              |    8 ++--\n t/t9111-git-svn-use-svnsync-props.sh          |    8 ++--\n t/t9112-git-svn-md5less-file.sh               |    4 +-\n t/t9113-git-svn-dcommit-new-file.sh           |    6 +-\n t/t9114-git-svn-dcommit-merge.sh              |    4 +-\n t/t9115-git-svn-dcommit-funky-renames.sh      |    4 +-\n t/t9116-git-svn-log.sh                        |    4 +-\n t/t9117-git-svn-init-clone.sh                 |   10 ++--\n t/t9118-git-svn-funky-branch-names.sh         |   12 +++---\n t/t9120-git-svn-clone-with-percent-escapes.sh |    2 +-\n t/t9500-gitweb-standalone-no-errors.sh        |   11 +++--\n 36 files changed, 205 insertions(+), 199 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex 27b54cb..690f80a 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -305,10 +305,10 @@ test_expect_success 'absolute path works as expected' '\n \tfile=\"$dir\"/index &&\n \ttest \"$file\" = \"$(test-absolute-path $dir2/index)\" &&\n \tbasename=blub &&\n-\ttest \"$dir/$basename\" = $(cd .git && test-absolute-path $basename) &&\n+\ttest \"$dir/$basename\" = \"$(cd .git && test-absolute-path \"$basename\")\" &&\n \tln -s ../first/file .git/syml &&\n \tsym=\"$(cd first; pwd -P)\"/file &&\n-\ttest \"$sym\" = \"$(test-absolute-path $dir2/syml)\"\n+\ttest \"$sym\" = \"$(test-absolute-path \"$dir2/syml\")\"\n '\n \n test_expect_success 'very long name in the index handled sanely' '\ndiff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh\nindex b9cef34..fc386ba 100755\n--- a/t/t1020-subdirectory.sh\n+++ b/t/t1020-subdirectory.sh\n@@ -21,7 +21,7 @@ LF='\n '\n \n test_expect_success 'update-index and ls-files' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit update-index --add one &&\n \tcase \"`git ls-files`\" in\n \tone) echo ok one ;;\n@@ -41,7 +41,7 @@ test_expect_success 'update-index and ls-files' '\n '\n \n test_expect_success 'cat-file' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \ttwo=`git ls-files -s dir/two` &&\n \ttwo=`expr \"$two\" : \"[0-7]* \\\\([0-9a-f]*\\\\)\"` &&\n \techo \"$two\" &&\n@@ -54,7 +54,7 @@ test_expect_success 'cat-file' '\n rm -f actual dir/actual\n \n test_expect_success 'diff-files' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \techo a >>one &&\n \techo d >>dir/two &&\n \tcase \"`git diff-files --name-only`\" in\n@@ -74,7 +74,7 @@ test_expect_success 'diff-files' '\n '\n \n test_expect_success 'write-tree' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \ttop=`git write-tree` &&\n \techo $top &&\n \tcd dir &&\n@@ -84,7 +84,7 @@ test_expect_success 'write-tree' '\n '\n \n test_expect_success 'checkout-index' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit checkout-index -f -u one &&\n \tcmp one original.one &&\n \tcd dir &&\n@@ -93,7 +93,7 @@ test_expect_success 'checkout-index' '\n '\n \n test_expect_success 'read-tree' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \trm -f one dir/two &&\n \ttree=`git write-tree` &&\n \tgit read-tree --reset -u \"$tree\" &&\n@@ -107,27 +107,27 @@ test_expect_success 'read-tree' '\n '\n \n test_expect_success 'no file/rev ambiguity check inside .git' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit commit -a -m 1 &&\n-\tcd $HERE/.git &&\n+\tcd \"$HERE\"/.git &&\n \tgit show -s HEAD\n '\n \n test_expect_success 'no file/rev ambiguity check inside a bare repo' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit clone -s --bare .git foo.git &&\n \tcd foo.git && GIT_DIR=. git show -s HEAD\n '\n \n # This still does not work as it should...\n : test_expect_success 'no file/rev ambiguity check inside a bare repo' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit clone -s --bare .git foo.git &&\n \tcd foo.git && git show -s HEAD\n '\n \n test_expect_success 'detection should not be fooled by a symlink' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \trm -fr foo.git &&\n \tgit clone -s .git another &&\n \tln -s another yetanother &&\ndiff --git a/t/t3050-subprojects-fetch.sh b/t/t3050-subprojects-fetch.sh\nindex 2b21b10..4261e96 100755\n--- a/t/t3050-subprojects-fetch.sh\n+++ b/t/t3050-subprojects-fetch.sh\n@@ -20,7 +20,7 @@ test_expect_success setup '\n '\n \n test_expect_success clone '\n-\tgit clone file://`pwd`/.git cloned &&\n+\tgit clone \"file://$(pwd)/.git\" cloned &&\n \t(git rev-parse HEAD; git ls-files -s) >expected &&\n \t(\n \t\tcd cloned &&\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 9cf873f..b9e3dbd 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -91,9 +91,8 @@ for line in $FAKE_LINES; do\n done\n EOF\n \n+test_set_editor \"$(pwd)/fake-editor.sh\"\n chmod a+x fake-editor.sh\n-VISUAL=\"$(pwd)/fake-editor.sh\"\n-export VISUAL\n \n test_expect_success 'no changes are a nop' '\n \tgit rebase -i F &&\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 1700d07..140e874 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -129,7 +129,7 @@ pull_to_client 2nd \"B\" $((64*3))\n \n pull_to_client 3rd \"A\" $((1*3)) # old fails\n \n-test_expect_success \"clone shallow\" \"git-clone --depth 2 file://`pwd`/. shallow\"\n+test_expect_success \"clone shallow\" 'git-clone --depth 2 \"file://$(pwd)/.\" shallow'\n \n (cd shallow; git count-objects -v) > count.shallow\n \ndiff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh\nindex c0dc949..1dd8eed 100755\n--- a/t/t5512-ls-remote.sh\n+++ b/t/t5512-ls-remote.sh\n@@ -17,7 +17,7 @@ test_expect_success setup '\n \t\tgit show-ref -d\t| sed -e \"s/ /\t/\"\n \t) >expected.all &&\n \n-\tgit remote add self $(pwd)/.git\n+\tgit remote add self \"$(pwd)/.git\"\n \n '\n \ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex 793ffc6..2b2b2ef 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -105,7 +105,7 @@ test_expect_success 'fetch with insteadOf' '\n \t(\n \t\tTRASH=$(pwd) &&\n \t\tcd testrepo &&\n-\t\tgit config url./$TRASH/.insteadOf trash/\n+\t\tgit config \"url./$TRASH/.insteadOf\" trash/ &&\n \t\tgit config remote.up.url trash/. &&\n \t\tgit config remote.up.fetch \"refs/heads/*:refs/remotes/origin/*\" &&\n \t\tgit fetch up &&\n@@ -146,7 +146,7 @@ test_expect_success 'push with wildcard' '\n test_expect_success 'push with insteadOf' '\n \tmk_empty &&\n \tTRASH=$(pwd) &&\n-\tgit config url./$TRASH/.insteadOf trash/ &&\n+\tgit config \"url./$TRASH/.insteadOf\" trash/ &&\n \tgit push trash/testrepo refs/heads/master:refs/remotes/origin/master &&\n \t(\n \t\tcd testrepo &&\ndiff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh\nindex b6a5486..e5619a9 100755\n--- a/t/t5700-clone-reference.sh\n+++ b/t/t5700-clone-reference.sh\n@@ -51,7 +51,7 @@ diff expected current'\n cd \"$base_dir\"\n \n test_expect_success 'cloning with reference (no -l -s)' \\\n-'git clone --reference B file://`pwd`/A D'\n+'git clone --reference B \"file://$(pwd)/A\" D'\n \n cd \"$base_dir\"\n \ndiff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh\nindex 910ccb4..1abf1a2 100755\n--- a/t/t5710-info-alternate.sh\n+++ b/t/t5710-info-alternate.sh\n@@ -81,7 +81,7 @@ test_valid_repo'\n cd \"$base_dir\"\n \n test_expect_success 'breaking of loops' \\\n-\"echo '$base_dir/B/.git/objects' >> '$base_dir'/A/.git/objects/info/alternates&&\n+\"echo \\\"\\$base_dir\\\"/B/.git/objects >> \\\"\\$base_dir\\\"/A/.git/objects/info/alternates&&\n cd C &&\n test_valid_repo\"\n \ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex efd658a..fd09030 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -125,7 +125,7 @@ test_expect_success 'use index-filter to move into a subdirectory' '\n \t\t \"git ls-files -s | sed \\\"s-\\\\t-&newsubdir/-\\\" |\n \t          GIT_INDEX_FILE=\\$GIT_INDEX_FILE.new \\\n \t\t\tgit update-index --index-info &&\n-\t\t  mv \\$GIT_INDEX_FILE.new \\$GIT_INDEX_FILE\" directorymoved &&\n+\t\t  mv \\\"\\$GIT_INDEX_FILE.new\\\" \\\"\\$GIT_INDEX_FILE\\\"\" directorymoved &&\n \ttest -z \"$(git diff HEAD directorymoved:newsubdir)\"'\n \n test_expect_success 'stops when msg filter fails' '\ndiff --git a/t/t7010-setup.sh b/t/t7010-setup.sh\nindex 02cf7c5..d8a7c79 100755\n--- a/t/t7010-setup.sh\n+++ b/t/t7010-setup.sh\n@@ -122,7 +122,7 @@ test_expect_success 'commit using absolute path names' '\n \n test_expect_success 'log using absolute path names' '\n \techo bb >>a/b/c/d &&\n-\tgit commit -m \"bb\" $(pwd)/a/b/c/d &&\n+\tgit commit -m \"bb\" \"$(pwd)/a/b/c/d\" &&\n \n \tgit log a/b/c/d >f1.txt &&\n \tgit log \"$(pwd)/a/b/c/d\" >f2.txt &&\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nindex afccfc9..54b1352 100755\n--- a/t/t7300-clean.sh\n+++ b/t/t7300-clean.sh\n@@ -111,7 +111,7 @@ test_expect_success 'git-clean with absolute path' '\n \ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n \twould_clean=$(\n \t\tcd docs &&\n-\t\tgit clean -n $(pwd)/../src |\n+\t\tgit clean -n \"$(pwd)/../src\" |\n \t\tsed -n -e \"s|^Would remove ||p\"\n \t) &&\n \ttest \"$would_clean\" = ../src/part3.c || {\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex c0288f3..e5fdb63 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -79,8 +79,8 @@ test_expect_success \\\n \n cat >editor <<\\EOF\n #!/bin/sh\n-sed -e \"s/a file/an amend commit/g\" < $1 > $1-\n-mv $1- $1\n+sed -e \"s/a file/an amend commit/g\" < \"$1\" > \"$1-\"\n+mv \"$1-\" \"$1\"\n EOF\n chmod 755 editor\n \n@@ -99,8 +99,8 @@ test_expect_success \\\n \n cat >editor <<\\EOF\n #!/bin/sh\n-sed -e \"s/amend/older/g\"  < $1 > $1-\n-mv $1- $1\n+sed -e \"s/amend/older/g\"  < \"$1\" > \"$1-\"\n+mv \"$1-\" \"$1\"\n EOF\n chmod 755 editor\n \ndiff --git a/t/t7504-commit-msg-hook.sh b/t/t7504-commit-msg-hook.sh\nindex eff36aa..88577af 100755\n--- a/t/t7504-commit-msg-hook.sh\n+++ b/t/t7504-commit-msg-hook.sh\n@@ -19,6 +19,9 @@ cp FAKE_MSG \"$1\"\n exit 0\n EOF\n chmod +x fake-editor\n+\n+## Not using test_set_editor here so we can easily ensure the editor variable\n+## is only set for the editor tests\n FAKE_EDITOR=\"$(pwd)/fake-editor\"\n export FAKE_EDITOR\n \n@@ -27,7 +30,7 @@ test_expect_success 'with no hook (editor)' '\n \techo \"more foo\" >> file &&\n \tgit add file &&\n \techo \"more foo\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit\n \n '\n \n@@ -44,7 +47,7 @@ test_expect_success '--no-verify with no hook (editor)' '\n \techo \"more bar\" > file &&\n \tgit add file &&\n \techo \"more bar\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify\n \n '\n \n@@ -71,7 +74,7 @@ test_expect_success 'with succeeding hook (editor)' '\n \techo \"more more\" >> file &&\n \tgit add file &&\n \techo \"more more\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit\n \n '\n \n@@ -88,7 +91,7 @@ test_expect_success '--no-verify with succeeding hook (editor)' '\n \techo \"even more more\" >> file &&\n \tgit add file &&\n \techo \"even more more\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify\n \n '\n \n@@ -111,7 +114,7 @@ test_expect_success 'with failing hook (editor)' '\n \techo \"more another\" >> file &&\n \tgit add file &&\n \techo \"more another\" > FAKE_MSG &&\n-\t! (GIT_EDITOR=\"$FAKE_EDITOR\" git commit)\n+\t! (GIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit)\n \n '\n \n@@ -128,7 +131,7 @@ test_expect_success '--no-verify with failing hook (editor)' '\n \techo \"more stuff\" >> file &&\n \tgit add file &&\n \techo \"more stuff\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify\n \n '\n \n@@ -146,7 +149,7 @@ test_expect_success 'with non-executable hook (editor)' '\n \techo \"content again\" >> file &&\n \tgit add file &&\n \techo \"content again\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit -m \"content again\"\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -m \"content again\"\n \n '\n \n@@ -163,7 +166,7 @@ test_expect_success '--no-verify with non-executable hook (editor)' '\n \techo \"even more content\" >> file &&\n \tgit add file &&\n \techo \"even more content\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify\n \n '\n \n@@ -193,7 +196,7 @@ test_expect_success 'hook edits commit message (editor)' '\n \techo \"additional content\" >> file &&\n \tgit add file &&\n \techo \"additional content\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit &&\n \tcommit_msg_is \"new message\"\n \n '\n@@ -212,7 +215,7 @@ test_expect_success \"hook doesn't edit commit message (editor)\" '\n \techo \"more plus\" >> file &&\n \tgit add file &&\n \techo \"more plus\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify &&\n \tcommit_msg_is \"more plus\"\n \n '\ndiff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh\nindex 802aa62..cd6c7c8 100755\n--- a/t/t7505-prepare-commit-msg-hook.sh\n+++ b/t/t7505-prepare-commit-msg-hook.sh\n@@ -18,6 +18,9 @@ cat > fake-editor <<'EOF'\n exit 0\n EOF\n chmod +x fake-editor\n+\n+## Not using test_set_editor here so we can easily ensure the editor variable\n+## is only set for the editor tests\n FAKE_EDITOR=\"$(pwd)/fake-editor\"\n export FAKE_EDITOR\n \n@@ -58,7 +61,7 @@ test_expect_success 'with hook (-m editor)' '\n \n \techo \"more\" >> file &&\n \tgit add file &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit -e -m \"more more\" &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -e -m \"more more\" &&\n \ttest \"`git log -1 --pretty=format:%s`\" = message\n \n '\n@@ -85,7 +88,7 @@ test_expect_success 'with hook (-F editor)' '\n \n \techo \"more\" >> file &&\n \tgit add file &&\n-\t(echo more more | GIT_EDITOR=\"$FAKE_EDITOR\" git commit -e -F -) &&\n+\t(echo more more | GIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -e -F -) &&\n \ttest \"`git log -1 --pretty=format:%s`\" = message\n \n '\n@@ -104,7 +107,7 @@ test_expect_success 'with hook (editor)' '\n \n \techo \"more more\" >> file &&\n \tgit add file &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit &&\n \ttest \"`git log -1 --pretty=format:%s`\" = default\n \n '\n@@ -114,7 +117,7 @@ test_expect_success 'with hook (--amend)' '\n \thead=`git rev-parse HEAD` &&\n \techo \"more\" >> file &&\n \tgit add file &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --amend &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --amend &&\n \ttest \"`git log -1 --pretty=format:%s`\" = \"$head\"\n \n '\n@@ -124,7 +127,7 @@ test_expect_success 'with hook (-c)' '\n \thead=`git rev-parse HEAD` &&\n \techo \"more\" >> file &&\n \tgit add file &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit -c $head &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -c $head &&\n \ttest \"`git log -1 --pretty=format:%s`\" = \"$head\"\n \n '\n@@ -139,7 +142,7 @@ test_expect_success 'with failing hook' '\n \thead=`git rev-parse HEAD` &&\n \techo \"more\" >> file &&\n \tgit add file &&\n-\t! GIT_EDITOR=\"$FAKE_EDITOR\" git commit -c $head\n+\t! GIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -c $head\n \n '\n \n@@ -148,7 +151,7 @@ test_expect_success 'with failing hook (--no-verify)' '\n \thead=`git rev-parse HEAD` &&\n \techo \"more\" >> file &&\n \tgit add file &&\n-\t! GIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify -c $head\n+\t! GIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify -c $head\n \n '\n \ndiff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh\nindex 4e24ab3..528c0a9 100755\n--- a/t/t9100-git-svn-basic.sh\n+++ b/t/t9100-git-svn-basic.sh\n@@ -31,16 +31,16 @@ test_expect_success \\\n \techo 'zzz' > bar/zzz &&\n \techo '#!/bin/sh' > exec.sh &&\n \tchmod +x exec.sh &&\n-\tsvn import -m 'import for git-svn' . $svnrepo >/dev/null &&\n+\tsvn import -m 'import for git-svn' . \\\"\\$svnrepo\\\" >/dev/null &&\n \tcd .. &&\n \trm -rf import &&\n-\tgit-svn init $svnrepo\"\n+\tgit-svn init \\\"\\$svnrepo\\\"\"\n \n test_expect_success \\\n     'import an SVN revision into git' \\\n     'git-svn fetch'\n \n-test_expect_success \"checkout from svn\" \"svn co $svnrepo '$SVN_TREE'\"\n+test_expect_success \"checkout from svn\" \"svn co \\\"\\$svnrepo\\\" \\\"\\$SVN_TREE\\\"\"\n \n name='try a deep --rmdir with a commit'\n test_expect_success \"$name\" \"\n@@ -51,8 +51,8 @@ test_expect_success \"$name\" \"\n \tgit commit -m '$name' &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -d '$SVN_TREE'/dir && test ! -d '$SVN_TREE'/dir/a\"\n+\tsvn up \\\"\\$SVN_TREE\\\" &&\n+\ttest -d \\\"\\$SVN_TREE\\\"/dir && test ! -d \\\"\\$SVN_TREE\\\"/dir/a\"\n \n \n name='detect node change from file to directory #1'\n@@ -69,7 +69,7 @@ test_expect_success \"$name\" \"\n \n name='detect node change from directory to file #1'\n test_expect_success \"$name\" \"\n-\trm -rf dir '$GIT_DIR'/index &&\n+\trm -rf dir \\\"\\$GIT_DIR\\\"/index &&\n \tgit checkout -f -b mybranch2 remotes/git-svn &&\n \tmv bar/zzz zzz &&\n \trm -rf bar &&\n@@ -83,7 +83,7 @@ test_expect_success \"$name\" \"\n \n name='detect node change from file to directory #2'\n test_expect_success \"$name\" \"\n-\trm -f '$GIT_DIR'/index &&\n+\trm -f \\\"\\$GIT_DIR\\\"/index &&\n \tgit checkout -f -b mybranch3 remotes/git-svn &&\n \trm bar/zzz &&\n \tgit update-index --remove bar/zzz &&\n@@ -97,7 +97,7 @@ test_expect_success \"$name\" \"\n \n name='detect node change from directory to file #2'\n test_expect_success \"$name\" \"\n-\trm -f '$GIT_DIR'/index &&\n+\trm -f \\\"\\$GIT_DIR\\\"/index &&\n \tgit checkout -f -b mybranch4 remotes/git-svn &&\n \trm -rf dir &&\n \tgit update-index --remove -- dir/file &&\n@@ -111,15 +111,15 @@ test_expect_success \"$name\" \"\n \n name='remove executable bit from a file'\n test_expect_success \"$name\" \"\n-\trm -f '$GIT_DIR'/index &&\n+\trm -f \\\"\\$GIT_DIR\\\"/index &&\n \tgit checkout -f -b mybranch5 remotes/git-svn &&\n \tchmod -x exec.sh &&\n \tgit update-index exec.sh &&\n \tgit commit -m '$name' &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest ! -x '$SVN_TREE'/exec.sh\"\n+\tsvn up \\\"\\$SVN_TREE\\\" &&\n+\ttest ! -x \\\"\\$SVN_TREE\\\"/exec.sh\"\n \n \n name='add executable bit back file'\n@@ -129,8 +129,8 @@ test_expect_success \"$name\" \"\n \tgit commit -m '$name' &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -x '$SVN_TREE'/exec.sh\"\n+\tsvn up \\\"\\$SVN_TREE\\\" &&\n+\ttest -x \\\"\\$SVN_TREE\\\"/exec.sh\"\n \n \n name='executable file becomes a symlink to bar/zzz (file)'\n@@ -141,8 +141,8 @@ test_expect_success \"$name\" \"\n \tgit commit -m '$name' &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -L '$SVN_TREE'/exec.sh\"\n+\tsvn up \\\"\\$SVN_TREE\\\" &&\n+\ttest -L \\\"\\$SVN_TREE\\\"/exec.sh\"\n \n name='new symlink is added to a file that was also just made executable'\n \n@@ -153,9 +153,9 @@ test_expect_success \"$name\" \"\n \tgit commit -m '$name' &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -x '$SVN_TREE'/bar/zzz &&\n-\ttest -L '$SVN_TREE'/exec-2.sh\"\n+\tsvn up \\\"\\$SVN_TREE\\\" &&\n+\ttest -x \\\"\\$SVN_TREE\\\"/bar/zzz &&\n+\ttest -L \\\"\\$SVN_TREE\\\"/exec-2.sh\"\n \n name='modify a symlink to become a file'\n test_expect_success \"$name\" \"\n@@ -166,10 +166,10 @@ test_expect_success \"$name\" \"\n \tgit commit -m '$name' &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -f '$SVN_TREE'/exec-2.sh &&\n-\ttest ! -L '$SVN_TREE'/exec-2.sh &&\n-\tgit diff help $SVN_TREE/exec-2.sh\"\n+\tsvn up \\\"\\$SVN_TREE\\\" &&\n+\ttest -f \\\"\\$SVN_TREE\\\"/exec-2.sh &&\n+\ttest ! -L \\\"\\$SVN_TREE\\\"/exec-2.sh &&\n+\tgit diff help \\\"\\$SVN_TREE\\\"/exec-2.sh\"\n \n if test \"$have_utf8\" = t\n then\n@@ -190,7 +190,7 @@ name='test fetch functionality (svn => git) with alternate GIT_SVN_ID'\n GIT_SVN_ID=alt\n export GIT_SVN_ID\n test_expect_success \"$name\" \\\n-    \"git-svn init $svnrepo && git-svn fetch &&\n+    \"git-svn init \\\"\\$svnrepo\\\" && git-svn fetch &&\n      git rev-list --pretty=raw remotes/git-svn | grep ^tree | uniq > a &&\n      git rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&\n      git diff a b\"\n@@ -220,16 +220,16 @@ test_expect_success 'exit if remote refs are ambigious' \"\n \"\n \n test_expect_success 'exit if init-ing a would clobber a URL' \"\n-        svnadmin create ${PWD}/svnrepo2 &&\n-        svn mkdir -m 'mkdir bar' ${svnrepo}2/bar &&\n+        svnadmin create \\\"\\${PWD}/svnrepo2\\\" &&\n+        svn mkdir -m 'mkdir bar' \\\"\\${svnrepo}2/bar\\\" &&\n         git config --unset svn-remote.svn.fetch \\\n                                 '^bar:refs/remotes/git-svn$' &&\n-\t! git-svn init ${svnrepo}2/bar\n+\t! git-svn init \\\"\\${svnrepo}2/bar\\\"\n         \"\n \n test_expect_success \\\n   'init allows us to connect to another directory in the same repo' \"\n-        git-svn init --minimize-url -i bar $svnrepo/bar &&\n+        git-svn init --minimize-url -i bar \\\"\\$svnrepo/bar\\\" &&\n         git config --get svn-remote.svn.fetch \\\n                               '^bar:refs/remotes/bar$' &&\n         git config --get svn-remote.svn.fetch \\\ndiff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\nindex d7a7047..fa8b7ee 100755\n--- a/t/t9101-git-svn-props.sh\n+++ b/t/t9101-git-svn-props.sh\n@@ -52,7 +52,7 @@ EOF\n cd ..\n \n rm -rf import\n-test_expect_success 'checkout working copy from svn' \"svn co $svnrepo test_wc\"\n+test_expect_success 'checkout working copy from svn' \"svn co \\\"\\$svnrepo\\\" test_wc\"\n test_expect_success 'setup some commits to svn' \\\n \t'cd test_wc &&\n \t\techo Greetings >> kw.c &&\n@@ -66,7 +66,7 @@ test_expect_success 'setup some commits to svn' \\\n \t\tsvn commit -m \"Propset Id\" &&\n \tcd ..'\n \n-test_expect_success 'initialize git-svn' \"git-svn init $svnrepo\"\n+test_expect_success 'initialize git-svn' \"git-svn init \\\"\\$svnrepo\\\"\"\n test_expect_success 'fetch revisions from svn' 'git-svn fetch'\n \n name='test svn:keywords ignoring'\n@@ -92,7 +92,7 @@ test_expect_success \"propset CR on crlf files\" \\\n test_expect_success 'fetch and pull latest from svn and checkout a new wc' \\\n \t\"git-svn fetch &&\n \t git pull . remotes/git-svn &&\n-\t svn co $svnrepo new_wc\"\n+\t svn co \\\"\\$svnrepo\\\" new_wc\"\n \n for i in crlf ne_crlf lf ne_lf cr ne_cr empty_cr empty_lf empty empty_crlf\n do\ndiff --git a/t/t9102-git-svn-deep-rmdir.sh b/t/t9102-git-svn-deep-rmdir.sh\nindex 4e08083..8eaf7d3 100755\n--- a/t/t9102-git-svn-deep-rmdir.sh\n+++ b/t/t9102-git-svn-deep-rmdir.sh\n@@ -9,12 +9,12 @@ test_expect_success 'initialize repo' \"\n \tmkdir -p deeply/nested/directory/number/2 &&\n \techo foo > deeply/nested/directory/number/1/file &&\n \techo foo > deeply/nested/directory/number/2/another &&\n-\tsvn import -m 'import for git-svn' . $svnrepo &&\n+\tsvn import -m 'import for git-svn' . \\\"\\$svnrepo\\\" &&\n \tcd ..\n \t\"\n \n test_expect_success 'mirror via git-svn' \"\n-\tgit-svn init $svnrepo &&\n+\tgit-svn init \\\"\\$svnrepo\\\" &&\n \tgit-svn fetch &&\n \tgit checkout -f -b test-rmdir remotes/git-svn\n \t\"\n@@ -23,7 +23,7 @@ test_expect_success 'Try a commit on rmdir' \"\n \tgit rm -f deeply/nested/directory/number/2/another &&\n \tgit commit -a -m 'remove another' &&\n \tgit-svn set-tree --rmdir HEAD &&\n-\tsvn ls -R $svnrepo | grep ^deeply/nested/directory/number/1\n+\tsvn ls -R \\\"\\$svnrepo\\\" | grep ^deeply/nested/directory/number/1\n \t\"\n \n \ndiff --git a/t/t9103-git-svn-tracked-directory-removed.sh b/t/t9103-git-svn-tracked-directory-removed.sh\nindex 0f0b0fd..c7734e6 100755\n--- a/t/t9103-git-svn-tracked-directory-removed.sh\n+++ b/t/t9103-git-svn-tracked-directory-removed.sh\n@@ -6,34 +6,34 @@\n test_description='git-svn tracking removed top-level path'\n . ./lib-git-svn.sh\n \n-test_expect_success 'make history for tracking' '\n+test_expect_success 'make history for tracking' \"\n \tmkdir import &&\n \tmkdir import/trunk &&\n \techo hello >> import/trunk/README &&\n-\tsvn import -m initial import $svnrepo &&\n+\tsvn import -m initial import \\\"\\$svnrepo\\\" &&\n \trm -rf import &&\n-\tsvn co $svnrepo/trunk trunk &&\n+\tsvn co \\\"\\$svnrepo\\\"/trunk trunk &&\n \techo bye bye >> trunk/README &&\n-\tsvn rm -m \"gone\" $svnrepo/trunk &&\n+\tsvn rm -m 'gone' \\\"\\$svnrepo\\\"/trunk &&\n \trm -rf trunk &&\n \tmkdir trunk &&\n-\techo \"new\" > trunk/FOLLOWME &&\n-\tsvn import -m \"new trunk\" trunk $svnrepo/trunk\n-'\n+\techo 'new' > trunk/FOLLOWME &&\n+\tsvn import -m 'new trunk' trunk \\\"\\$svnrepo\\\"/trunk\n+\"\n \n-test_expect_success 'clone repo with git' '\n-\tgit svn clone -s $svnrepo x &&\n+test_expect_success 'clone repo with git' \"\n+\tgit svn clone -s \\\"\\$svnrepo\\\" x &&\n \ttest -f x/FOLLOWME &&\n \ttest ! -f x/README\n-'\n+\"\n \n-test_expect_success 'make sure r2 still has old file' '\n+test_expect_success 'make sure r2 still has old file' \"\n \tcd x &&\n-\t\ttest -n \"$(git svn find-rev r1)\" &&\n-\t\tgit reset --hard $(git svn find-rev r1) &&\n+\t\ttest -n \\\"\\$(git svn find-rev r1)\\\" &&\n+\t\tgit reset --hard \\$(git svn find-rev r1) &&\n \t\ttest -f README &&\n \t\ttest ! -f FOLLOWME &&\n-\t\ttest x$(git svn find-rev r2) = x\n-'\n+\t\ttest x\\$(git svn find-rev r2) = x\n+\"\n \n test_done\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex 7ba7630..56b1704 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -11,9 +11,9 @@ test_expect_success 'initialize repo' \"\n \tcd import &&\n \tmkdir -p trunk &&\n \techo hello > trunk/readme &&\n-\tsvn import -m 'initial' . $svnrepo &&\n+\tsvn import -m 'initial' . \\\"\\$svnrepo\\\" &&\n \tcd .. &&\n-\tsvn co $svnrepo wc &&\n+\tsvn co \\\"\\$svnrepo\\\" wc &&\n \tcd wc &&\n \techo world >> trunk/readme &&\n \tpoke trunk/readme &&\n@@ -27,7 +27,7 @@ test_expect_success 'initialize repo' \"\n \t\"\n \n test_expect_success 'init and fetch a moved directory' \"\n-\tgit-svn init --minimize-url -i thunk $svnrepo/thunk &&\n+\tgit-svn init --minimize-url -i thunk \\\"\\$svnrepo\\\"/thunk &&\n \tgit-svn fetch -i thunk &&\n \ttest \\\"\\`git rev-parse --verify refs/remotes/thunk@2\\`\\\" \\\n            = \\\"\\`git rev-parse --verify refs/remotes/thunk~1\\`\\\" &&\n@@ -38,7 +38,7 @@ test_expect_success 'init and fetch a moved directory' \"\n \t\"\n \n test_expect_success 'init and fetch from one svn-remote' \"\n-        git config svn-remote.svn.url $svnrepo &&\n+        git config svn-remote.svn.url \\\"\\$svnrepo\\\" &&\n         git config --add svn-remote.svn.fetch \\\n           trunk:refs/remotes/svn/trunk &&\n         git config --add svn-remote.svn.fetch \\\n@@ -52,9 +52,9 @@ test_expect_success 'init and fetch from one svn-remote' \"\n \n test_expect_success 'follow deleted parent' \"\n         (svn cp -m 'resurrecting trunk as junk' \\\n-               $svnrepo/trunk@2 $svnrepo/junk ||\n+               \\\"\\$svnrepo\\\"/trunk@2 \\\"\\$svnrepo\\\"/junk ||\n          svn cp -m 'resurrecting trunk as junk' \\\n-               -r2 $svnrepo/trunk $svnrepo/junk) &&\n+               -r2 \\\"\\$svnrepo\\\"/trunk \\\"\\$svnrepo\\\"/junk) &&\n         git config --add svn-remote.svn.fetch \\\n           junk:refs/remotes/svn/junk &&\n         git-svn fetch -i svn/thunk &&\n@@ -67,10 +67,10 @@ test_expect_success 'follow deleted parent' \"\n test_expect_success 'follow larger parent' \"\n         mkdir -p import/trunk/thunk/bump/thud &&\n         echo hi > import/trunk/thunk/bump/thud/file &&\n-        svn import -m 'import a larger parent' import $svnrepo/larger-parent &&\n-        svn cp -m 'hi' $svnrepo/larger-parent $svnrepo/another-larger &&\n+        svn import -m 'import a larger parent' import \\\"\\$svnrepo\\\"/larger-parent &&\n+        svn cp -m 'hi' \\\"\\$svnrepo\\\"/larger-parent \\\"\\$svnrepo\\\"/another-larger &&\n         git-svn init --minimize-url -i larger \\\n-          $svnrepo/another-larger/trunk/thunk/bump/thud &&\n+          \\\"\\$svnrepo\\\"/another-larger/trunk/thunk/bump/thud &&\n         git-svn fetch -i larger &&\n         git rev-parse --verify refs/remotes/larger &&\n         git rev-parse --verify \\\n@@ -83,23 +83,23 @@ test_expect_success 'follow larger parent' \"\n         \"\n \n test_expect_success 'follow higher-level parent' \"\n-        svn mkdir -m 'follow higher-level parent' $svnrepo/blob &&\n-        svn co $svnrepo/blob blob &&\n+        svn mkdir -m 'follow higher-level parent' \\\"\\$svnrepo\\\"/blob &&\n+        svn co \\\"\\$svnrepo\\\"/blob blob &&\n         cd blob &&\n                 echo hi > hi &&\n                 svn add hi &&\n                 svn commit -m 'hihi' &&\n                 cd ..\n-        svn mkdir -m 'new glob at top level' $svnrepo/glob &&\n-        svn mv -m 'move blob down a level' $svnrepo/blob $svnrepo/glob/blob &&\n-        git-svn init --minimize-url -i blob $svnrepo/glob/blob &&\n+        svn mkdir -m 'new glob at top level' \\\"\\$svnrepo\\\"/glob &&\n+        svn mv -m 'move blob down a level' \\\"\\$svnrepo\\\"/blob \\\"\\$svnrepo\\\"/glob/blob &&\n+        git-svn init --minimize-url -i blob \\\"\\$svnrepo\\\"/glob/blob &&\n         git-svn fetch -i blob\n         \"\n \n test_expect_success 'follow deleted directory' \"\n-\tsvn mv -m 'bye!' $svnrepo/glob/blob/hi $svnrepo/glob/blob/bye &&\n-\tsvn rm -m 'remove glob' $svnrepo/glob &&\n-\tgit-svn init --minimize-url -i glob $svnrepo/glob &&\n+\tsvn mv -m 'bye!' \\\"\\$svnrepo\\\"/glob/blob/hi \\\"\\$svnrepo\\\"/glob/blob/bye &&\n+\tsvn rm -m 'remove glob' \\\"\\$svnrepo\\\"/glob &&\n+\tgit-svn init --minimize-url -i glob \\\"\\$svnrepo\\\"/glob &&\n \tgit-svn fetch -i glob &&\n \ttest \\\"\\`git cat-file blob refs/remotes/glob:blob/bye\\`\\\" = hi &&\n \ttest \\\"\\`git ls-tree refs/remotes/glob | wc -l \\`\\\" -eq 1\n@@ -118,9 +118,9 @@ test_expect_success 'follow-parent avoids deleting relevant info' \"\n \t  echo 'bad delete test 2' > \\\n \t   import/trunk/subversion/bindings/swig/perl/another-larger &&\n \tcd import &&\n-\t  svn import -m 'r9270 test' . $svnrepo/r9270 &&\n+\t  svn import -m 'r9270 test' . \\\"\\$svnrepo\\\"/r9270 &&\n \tcd .. &&\n-\tsvn co $svnrepo/r9270/trunk/subversion/bindings/swig/perl r9270 &&\n+\tsvn co \\\"\\$svnrepo\\\"/r9270/trunk/subversion/bindings/swig/perl r9270 &&\n \tcd r9270 &&\n \t  svn mkdir native &&\n \t  svn mv t native/t &&\n@@ -130,7 +130,7 @@ test_expect_success 'follow-parent avoids deleting relevant info' \"\n \t  svn commit -m 'reorg test' &&\n \tcd .. &&\n \tgit-svn init --minimize-url -i r9270-t \\\n-\t  $svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t &&\n+\t  \\\"\\$svnrepo\\\"/r9270/trunk/subversion/bindings/swig/perl/native/t &&\n \tgit-svn fetch -i r9270-t &&\n \ttest \\`git rev-list r9270-t | wc -l\\` -eq 2 &&\n \ttest \\\"\\`git ls-tree --name-only r9270-t~1\\`\\\" = \\\n@@ -138,9 +138,9 @@ test_expect_success 'follow-parent avoids deleting relevant info' \"\n \t\"\n \n test_expect_success \"track initial change if it was only made to parent\" \"\n-\tsvn cp -m 'wheee!' $svnrepo/r9270/trunk $svnrepo/r9270/drunk &&\n+\tsvn cp -m 'wheee!' \\\"\\$svnrepo\\\"/r9270/trunk \\\"\\$svnrepo\\\"/r9270/drunk &&\n \tgit-svn init --minimize-url -i r9270-d \\\n-\t  $svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t &&\n+\t  \\\"\\$svnrepo\\\"/r9270/drunk/subversion/bindings/swig/perl/native/t &&\n \tgit-svn fetch -i r9270-d &&\n \ttest \\`git rev-list r9270-d | wc -l\\` -eq 3 &&\n \ttest \\\"\\`git ls-tree --name-only r9270-t\\`\\\" = \\\n@@ -150,7 +150,7 @@ test_expect_success \"track initial change if it was only made to parent\" \"\n \t\"\n \n test_expect_success \"track multi-parent paths\" \"\n-\tsvn cp -m 'resurrect /glob' $svnrepo/r9270 $svnrepo/glob &&\n+\tsvn cp -m 'resurrect /glob' \\\"\\$svnrepo\\\"/r9270 \\\"\\$svnrepo\\\"/glob &&\n \tgit-svn multi-fetch &&\n \ttest \\`git cat-file commit refs/remotes/glob | \\\n \t       grep '^parent ' | wc -l\\` -eq 2\n@@ -161,8 +161,8 @@ test_expect_success \"multi-fetch continues to work\" \"\n \t\"\n \n test_expect_success \"multi-fetch works off a 'clean' repository\" \"\n-\trm -r $GIT_DIR/svn $GIT_DIR/refs/remotes $GIT_DIR/logs &&\n-\tmkdir $GIT_DIR/svn &&\n+\trm -r \\\"\\$GIT_DIR/svn\\\" \\\"\\$GIT_DIR/refs/remotes\\\" \\\"\\$GIT_DIR/logs\\\" &&\n+\tmkdir \\\"\\$GIT_DIR/svn\\\" &&\n \tgit-svn multi-fetch\n \t\"\n \ndiff --git a/t/t9105-git-svn-commit-diff.sh b/t/t9105-git-svn-commit-diff.sh\nindex 318e172..4f7f9cc 100755\n--- a/t/t9105-git-svn-commit-diff.sh\n+++ b/t/t9105-git-svn-commit-diff.sh\n@@ -8,7 +8,7 @@ test_expect_success 'initialize repo' \"\n \tmkdir import &&\n \tcd import &&\n \techo hello > readme &&\n-\tsvn import -m 'initial' . $svnrepo &&\n+\tsvn import -m 'initial' . \\\"\\$svnrepo\\\" &&\n \tcd .. &&\n \techo hello > readme &&\n \tgit update-index --add readme &&\n@@ -26,17 +26,17 @@ prev=`git rev-parse --verify HEAD^1`\n \n test_expect_success 'test the commit-diff command' \"\n \ttest -n '$prev' && test -n '$head' &&\n-\tgit-svn commit-diff -r1 '$prev' '$head' '$svnrepo' &&\n-\tsvn co $svnrepo wc &&\n+\tgit-svn commit-diff -r1 '$prev' '$head' \\\"\\$svnrepo\\\" &&\n+\tsvn co \\\"\\$svnrepo\\\" wc &&\n \tcmp readme wc/readme\n \t\"\n \n test_expect_success 'commit-diff to a sub-directory (with git-svn config)' \"\n-\tsvn import -m 'sub-directory' import $svnrepo/subdir &&\n-\tgit-svn init --minimize-url $svnrepo/subdir &&\n+\tsvn import -m 'sub-directory' import \\\"\\$svnrepo\\\"/subdir &&\n+\tgit-svn init --minimize-url \\\"\\$svnrepo\\\"/subdir &&\n \tgit-svn fetch &&\n \tgit-svn commit-diff -r3 '$prev' '$head' &&\n-\tsvn cat $svnrepo/subdir/readme > readme.2 &&\n+\tsvn cat \\\"\\$svnrepo\\\"/subdir/readme > readme.2 &&\n \tcmp readme readme.2\n \t\"\n \ndiff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh\nindex f74ab12..bb544f6 100755\n--- a/t/t9106-git-svn-commit-diff-clobber.sh\n+++ b/t/t9106-git-svn-commit-diff-clobber.sh\n@@ -8,14 +8,14 @@ test_expect_success 'initialize repo' \"\n \tmkdir import &&\n \tcd import &&\n \techo initial > file &&\n-\tsvn import -m 'initial' . $svnrepo &&\n+\tsvn import -m 'initial' . \\\"\\$svnrepo\\\" &&\n \tcd .. &&\n \techo initial > file &&\n \tgit update-index --add file &&\n \tgit commit -a -m 'initial'\n \t\"\n test_expect_success 'commit change from svn side' \"\n-\tsvn co $svnrepo t.svn &&\n+\tsvn co \\\"\\$svnrepo\\\" t.svn &&\n \tcd t.svn &&\n \techo second line from svn >> file &&\n \tpoke file &&\n@@ -27,7 +27,7 @@ test_expect_success 'commit change from svn side' \"\n test_expect_success 'commit conflicting change from git' \"\n \techo second line from git >> file &&\n \tgit commit -a -m 'second line from git' &&\n-\t! git-svn commit-diff -r1 HEAD~1 HEAD $svnrepo\n+\t! git-svn commit-diff -r1 HEAD~1 HEAD \\\"\\$svnrepo\\\"\n \"\n \n test_expect_success 'commit complementing change from git' \"\n@@ -36,14 +36,14 @@ test_expect_success 'commit complementing change from git' \"\n \tgit commit -a -m 'second line from svn' &&\n \techo third line from git >> file &&\n \tgit commit -a -m 'third line from git' &&\n-\tgit-svn commit-diff -r2 HEAD~1 HEAD $svnrepo\n+\tgit-svn commit-diff -r2 HEAD~1 HEAD \\\"\\$svnrepo\\\"\n \t\"\n \n test_expect_success 'dcommit fails to commit because of conflict' \"\n-\tgit-svn init $svnrepo &&\n+\tgit-svn init \\\"\\$svnrepo\\\" &&\n \tgit-svn fetch &&\n \tgit reset --hard refs/remotes/git-svn &&\n-\tsvn co $svnrepo t.svn &&\n+\tsvn co \\\"\\$svnrepo\\\" t.svn &&\n \tcd t.svn &&\n \techo fourth line from svn >> file &&\n \tpoke file &&\n@@ -67,7 +67,7 @@ test_expect_success 'dcommit does the svn equivalent of an index merge' \"\n \t\"\n \n test_expect_success 'commit another change from svn side' \"\n-\tsvn co $svnrepo t.svn &&\n+\tsvn co \\\"\\$svnrepo\\\" t.svn &&\n \tcd t.svn &&\n \t\techo third line from svn >> file &&\n \t\tpoke file &&\ndiff --git a/t/t9106-git-svn-dcommit-clobber-series.sh b/t/t9106-git-svn-dcommit-clobber-series.sh\nindex ca8a00e..477755a 100755\n--- a/t/t9106-git-svn-dcommit-clobber-series.sh\n+++ b/t/t9106-git-svn-dcommit-clobber-series.sh\n@@ -8,9 +8,9 @@ test_expect_success 'initialize repo' \"\n \tmkdir import &&\n \tcd import &&\n \tawk 'BEGIN { for (i = 1; i < 64; i++) { print i } }' > file\n-\tsvn import -m 'initial' . $svnrepo &&\n+\tsvn import -m 'initial' . \\\"\\$svnrepo\\\" &&\n \tcd .. &&\n-\tgit svn init $svnrepo &&\n+\tgit svn init \\\"\\$svnrepo\\\" &&\n \tgit svn fetch &&\n \ttest -e file\n \t\"\n@@ -18,7 +18,7 @@ test_expect_success 'initialize repo' \"\n test_expect_success '(supposedly) non-conflicting change from SVN' \"\n \ttest x\\\"\\`sed -n -e 58p < file\\`\\\" = x58 &&\n \ttest x\\\"\\`sed -n -e 61p < file\\`\\\" = x61 &&\n-\tsvn co $svnrepo tmp &&\n+\tsvn co \\\"\\$svnrepo\\\" tmp &&\n \tcd tmp &&\n \t\tperl -i -p -e 's/^58\\$/5588/' file &&\n \t\tperl -i -p -e 's/^61\\$/6611/' file &&\ndiff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh\nindex 0a41d52..9ab7074 100755\n--- a/t/t9107-git-svn-migrate.sh\n+++ b/t/t9107-git-svn-migrate.sh\n@@ -4,7 +4,7 @@ test_description='git-svn metadata migrations from previous versions'\n . ./lib-git-svn.sh\n \n test_expect_success 'setup old-looking metadata' \"\n-\tcp $GIT_DIR/config $GIT_DIR/config-old-git-svn &&\n+\tcp \\\"\\$GIT_DIR\\\"/config \\\"\\$GIT_DIR\\\"/config-old-git-svn &&\n \tmkdir import &&\n \tcd import &&\n \t\tfor i in trunk branches/a branches/b \\\n@@ -12,13 +12,13 @@ test_expect_success 'setup old-looking metadata' \"\n \t\t\tmkdir -p \\$i && \\\n \t\t\techo hello >> \\$i/README || exit 1\n \t\tdone && \\\n-\t\tsvn import -m test . $svnrepo\n+\t\tsvn import -m test . \\\"\\$svnrepo\\\"\n \t\tcd .. &&\n-\tgit-svn init $svnrepo &&\n+\tgit-svn init \\\"\\$svnrepo\\\" &&\n \tgit-svn fetch &&\n-\tmv $GIT_DIR/svn/* $GIT_DIR/ &&\n-\tmv $GIT_DIR/svn/.metadata $GIT_DIR/ &&\n-\trmdir $GIT_DIR/svn &&\n+\tmv \\\"\\$GIT_DIR\\\"/svn/* \\\"\\$GIT_DIR\\\"/ &&\n+\tmv \\\"\\$GIT_DIR\\\"/svn/.metadata \\\"\\$GIT_DIR\\\"/ &&\n+\trmdir \\\"\\$GIT_DIR\\\"/svn &&\n \tgit update-ref refs/heads/git-svn-HEAD refs/remotes/git-svn &&\n \tgit update-ref refs/heads/svn-HEAD refs/remotes/git-svn &&\n \tgit update-ref -d refs/remotes/git-svn refs/remotes/git-svn\n@@ -28,20 +28,20 @@ head=`git rev-parse --verify refs/heads/git-svn-HEAD^0`\n test_expect_success 'git-svn-HEAD is a real HEAD' \"test -n '$head'\"\n \n test_expect_success 'initialize old-style (v0) git-svn layout' \"\n-\tmkdir -p $GIT_DIR/git-svn/info $GIT_DIR/svn/info &&\n-\techo $svnrepo > $GIT_DIR/git-svn/info/url &&\n-\techo $svnrepo > $GIT_DIR/svn/info/url &&\n+\tmkdir -p \\\"\\$GIT_DIR\\\"/git-svn/info \\\"\\$GIT_DIR\\\"/svn/info &&\n+\techo \\\"\\$svnrepo\\\" > \\\"\\$GIT_DIR\\\"/git-svn/info/url &&\n+\techo \\\"\\$svnrepo\\\" > \\\"\\$GIT_DIR\\\"/svn/info/url &&\n \tgit-svn migrate &&\n-\t! test -d $GIT_DIR/git-svn &&\n+\t! test -d \\\"\\$GIT_DIR\\\"/git-svn &&\n \tgit rev-parse --verify refs/remotes/git-svn^0 &&\n \tgit rev-parse --verify refs/remotes/svn^0 &&\n-\ttest \\`git config --get svn-remote.svn.url\\` = '$svnrepo' &&\n+\ttest \\\"\\$(git config --get svn-remote.svn.url)\\\" = \\\"\\$svnrepo\\\" &&\n \ttest \\`git config --get svn-remote.svn.fetch\\` = \\\n              ':refs/remotes/git-svn'\n \t\"\n \n test_expect_success 'initialize a multi-repository repo' \"\n-\tgit-svn init $svnrepo -T trunk -t tags -b branches &&\n+\tgit-svn init \\\"\\$svnrepo\\\" -T trunk -t tags -b branches &&\n \tgit config --get-all svn-remote.svn.fetch > fetch.out &&\n \tgrep '^trunk:refs/remotes/trunk$' fetch.out &&\n \ttest -n \\\"\\`git config --get svn-remote.svn.branches \\\n@@ -76,14 +76,14 @@ test_expect_success 'multi-fetch works on partial urls + paths' \"\n test_expect_success 'migrate --minimize on old inited layout' \"\n \tgit config --unset-all svn-remote.svn.fetch &&\n \tgit config --unset-all svn-remote.svn.url &&\n-\trm -rf $GIT_DIR/svn &&\n+\trm -rf \\\"\\$GIT_DIR\\\"/svn &&\n \tfor i in \\`cat fetch.out\\`; do\n \t\tpath=\\`expr \\$i : '\\\\([^:]*\\\\):.*$'\\`\n \t\tref=\\`expr \\$i : '[^:]*:refs/remotes/\\\\(.*\\\\)$'\\`\n \t\tif test -z \\\"\\$ref\\\"; then continue; fi\n \t\tif test -n \\\"\\$path\\\"; then path=\\\"/\\$path\\\"; fi\n-\t\t( mkdir -p $GIT_DIR/svn/\\$ref/info/ &&\n-\t\techo $svnrepo\\$path > $GIT_DIR/svn/\\$ref/info/url ) || exit 1;\n+\t\t( mkdir -p \\\"\\$GIT_DIR\\\"/svn/\\$ref/info/ &&\n+\t\techo \\\"\\$svnrepo\\\"\\$path > \\\"\\$GIT_DIR\\\"/svn/\\$ref/info/url ) || exit 1;\n \tdone &&\n \tgit-svn migrate --minimize &&\n \ttest -z \\\"\\`git config -l |grep -v '^svn-remote\\.git-svn\\.'\\`\\\" &&\n@@ -99,17 +99,17 @@ test_expect_success 'migrate --minimize on old inited layout' \"\n \n test_expect_success  \".rev_db auto-converted to .rev_map.UUID\" \"\n \tgit-svn fetch -i trunk &&\n-\ttest -z \\\"\\$(ls $GIT_DIR/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n-\texpect=\\\"\\$(ls $GIT_DIR/svn/trunk/.rev_map.*)\\\" &&\n+\ttest -z \\\"\\$(ls \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n+\texpect=\\\"\\$(ls \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_map.*)\\\" &&\n \ttest -n \\\"\\$expect\\\" &&\n-\trev_db=\\$(echo \\$expect | sed -e 's,_map,_db,') &&\n-\tconvert_to_rev_db \\$expect \\$rev_db &&\n-\trm -f \\$expect &&\n-\ttest -f \\$rev_db &&\n+\trev_db=\\\"\\$(echo \\$expect | sed -e 's,_map,_db,')\\\" &&\n+\tconvert_to_rev_db \\\"\\$expect\\\" \\\"\\$rev_db\\\" &&\n+\trm -f \\\"\\$expect\\\" &&\n+\ttest -f \\\"\\$rev_db\\\" &&\n \tgit-svn fetch -i trunk &&\n-\ttest -z \\\"\\$(ls $GIT_DIR/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n-\ttest ! -e $GIT_DIR/svn/trunk/.rev_db &&\n-\ttest -f \\$expect\n+\ttest -z \\\"\\$(ls \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n+\ttest ! -e \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_db &&\n+\ttest -f \\\"\\$expect\\\"\n \t\"\n \n test_done\ndiff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh\nindex db4344c..8f03f2d 100755\n--- a/t/t9108-git-svn-glob.sh\n+++ b/t/t9108-git-svn-glob.sh\n@@ -14,8 +14,8 @@ test_expect_success 'test refspec globbing' \"\n \tmkdir -p trunk/src/a trunk/src/b trunk/doc &&\n \techo 'hello world' > trunk/src/a/readme &&\n \techo 'goodbye world' > trunk/src/b/readme &&\n-\tsvn import -m 'initial' trunk $svnrepo/trunk &&\n-\tsvn co $svnrepo tmp &&\n+\tsvn import -m 'initial' trunk \\\"\\$svnrepo\\\"/trunk &&\n+\tsvn co \\\"\\$svnrepo\\\" tmp &&\n \tcd tmp &&\n \t\tmkdir branches tags &&\n \t\tsvn add branches tags &&\n@@ -38,7 +38,7 @@ test_expect_success 'test refspec globbing' \"\n \t\tpoke tags/end/src/b/readme &&\n \t\tsvn commit -m 'nothing to see here'\n \t\tcd .. &&\n-\tgit config --add svn-remote.svn.url $svnrepo &&\n+\tgit config --add svn-remote.svn.url \\\"\\$svnrepo\\\" &&\n \tgit config --add svn-remote.svn.fetch \\\n \t                 'trunk/src/a:refs/remotes/trunk' &&\n \tgit config --add svn-remote.svn.branches \\\n@@ -60,7 +60,7 @@ echo nothing to see here >> expect.two\n cat expect.end >> expect.two\n \n test_expect_success 'test left-hand-side only globbing' \"\n-\tgit config --add svn-remote.two.url $svnrepo &&\n+\tgit config --add svn-remote.two.url \\\"\\$svnrepo\\\" &&\n \tgit config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk &&\n \tgit config --add svn-remote.two.branches \\\n \t                 'branches/*:refs/remotes/two/branches/*' &&\ndiff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh\nindex 6235af4..d9ac558 100755\n--- a/t/t9110-git-svn-use-svm-props.sh\n+++ b/t/t9110-git-svn-use-svm-props.sh\n@@ -8,11 +8,11 @@ test_description='git-svn useSvmProps test'\n . ./lib-git-svn.sh\n \n test_expect_success 'load svm repo' \"\n-\tsvnadmin load -q $rawsvnrepo < ../t9110/svm.dump &&\n-\tgit-svn init --minimize-url -R arr -i bar $svnrepo/mirror/arr &&\n-\tgit-svn init --minimize-url -R argh -i dir $svnrepo/mirror/argh &&\n+\tsvnadmin load -q \\\"\\$rawsvnrepo\\\" < ../t9110/svm.dump &&\n+\tgit-svn init --minimize-url -R arr -i bar \\\"\\$svnrepo\\\"/mirror/arr &&\n+\tgit-svn init --minimize-url -R argh -i dir \\\"\\$svnrepo\\\"/mirror/argh &&\n \tgit-svn init --minimize-url -R argh -i e \\\n-\t  $svnrepo/mirror/argh/a/b/c/d/e &&\n+\t  \\\"\\$svnrepo\\\"/mirror/argh/a/b/c/d/e &&\n \tgit config svn.useSvmProps true &&\n \tgit-svn fetch --all\n \t\"\ndiff --git a/t/t9111-git-svn-use-svnsync-props.sh b/t/t9111-git-svn-use-svnsync-props.sh\nindex ec7dedd..77185bc 100755\n--- a/t/t9111-git-svn-use-svnsync-props.sh\n+++ b/t/t9111-git-svn-use-svnsync-props.sh\n@@ -8,10 +8,10 @@ test_description='git-svn useSvnsyncProps test'\n . ./lib-git-svn.sh\n \n test_expect_success 'load svnsync repo' \"\n-\tsvnadmin load -q $rawsvnrepo < ../t9111/svnsync.dump &&\n-\tgit-svn init --minimize-url -R arr -i bar $svnrepo/bar &&\n-\tgit-svn init --minimize-url -R argh -i dir $svnrepo/dir &&\n-\tgit-svn init --minimize-url -R argh -i e $svnrepo/dir/a/b/c/d/e &&\n+\tsvnadmin load -q \\\"\\$rawsvnrepo\\\" < ../t9111/svnsync.dump &&\n+\tgit-svn init --minimize-url -R arr -i bar \\\"\\$svnrepo\\\"/bar &&\n+\tgit-svn init --minimize-url -R argh -i dir \\\"\\$svnrepo\\\"/dir &&\n+\tgit-svn init --minimize-url -R argh -i e \\\"\\$svnrepo\\\"/dir/a/b/c/d/e &&\n \tgit config svn.useSvnsyncProps true &&\n \tgit-svn fetch --all\n \t\"\ndiff --git a/t/t9112-git-svn-md5less-file.sh b/t/t9112-git-svn-md5less-file.sh\nindex 646a5f0..fb1491d 100755\n--- a/t/t9112-git-svn-md5less-file.sh\n+++ b/t/t9112-git-svn-md5less-file.sh\n@@ -40,8 +40,8 @@ PROPS-END\n \n EOF\n \n-test_expect_success 'load svn dumpfile' \"svnadmin load $rawsvnrepo < dumpfile.svn\"\n+test_expect_success 'load svn dumpfile' \"svnadmin load \\\"\\$rawsvnrepo\\\" < dumpfile.svn\"\n \n-test_expect_success 'initialize git-svn' \"git-svn init $svnrepo\"\n+test_expect_success 'initialize git-svn' \"git-svn init \\\"\\$svnrepo\\\"\"\n test_expect_success 'fetch revisions from svn' 'git-svn fetch'\n test_done\ndiff --git a/t/t9113-git-svn-dcommit-new-file.sh b/t/t9113-git-svn-dcommit-new-file.sh\nindex 9ef0db9..b92a64e 100755\n--- a/t/t9113-git-svn-dcommit-new-file.sh\n+++ b/t/t9113-git-svn-dcommit-new-file.sh\n@@ -15,14 +15,14 @@ test_description='git-svn dcommit new files over svn:// test'\n \n start_svnserve () {\n \tsvnserve --listen-port $SVNSERVE_PORT \\\n-\t         --root $rawsvnrepo \\\n+\t         --root \"$rawsvnrepo\" \\\n \t         --listen-once \\\n \t         --listen-host 127.0.0.1 &\n }\n \n test_expect_success 'start tracking an empty repo' \"\n-\tsvn mkdir -m 'empty dir' $svnrepo/empty-dir &&\n-\techo anon-access = write >> $rawsvnrepo/conf/svnserve.conf &&\n+\tsvn mkdir -m 'empty dir' \\\"\\$svnrepo\\\"/empty-dir &&\n+\techo anon-access = write >> \\\"\\$rawsvnrepo\\\"/conf/svnserve.conf &&\n \tstart_svnserve &&\n \tgit svn init svn://127.0.0.1:$SVNSERVE_PORT &&\n \tgit svn fetch\ndiff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh\nindex 225060b..74b971c 100755\n--- a/t/t9114-git-svn-dcommit-merge.sh\n+++ b/t/t9114-git-svn-dcommit-merge.sh\n@@ -35,7 +35,7 @@ EOF\n }\n \n test_expect_success 'setup svn repository' \"\n-\tsvn co $svnrepo mysvnwork &&\n+\tsvn co \\\"\\$svnrepo\\\" mysvnwork &&\n \tmkdir -p mysvnwork/trunk &&\n \tcd mysvnwork &&\n \t\tbig_text_block >> trunk/README &&\n@@ -45,7 +45,7 @@ test_expect_success 'setup svn repository' \"\n \t\"\n \n test_expect_success 'setup git mirror and merge' \"\n-\tgit svn init $svnrepo -t tags -T trunk -b branches &&\n+\tgit svn init \\\"\\$svnrepo\\\" -t tags -T trunk -b branches &&\n \tgit svn fetch &&\n \tgit checkout --track -b svn remotes/trunk &&\n \tgit checkout -b merge &&\ndiff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh\nindex 182299c..f83f4f9 100755\n--- a/t/t9115-git-svn-dcommit-funky-renames.sh\n+++ b/t/t9115-git-svn-dcommit-funky-renames.sh\n@@ -8,12 +8,12 @@ test_description='git-svn dcommit can commit renames of files with ugly names'\n . ./lib-git-svn.sh\n \n test_expect_success 'load repository with strange names' \"\n-\tsvnadmin load -q $rawsvnrepo < ../t9115/funky-names.dump &&\n+\tsvnadmin load -q \\\"\\$rawsvnrepo\\\" < ../t9115/funky-names.dump &&\n \tstart_httpd\n \t\"\n \n test_expect_success 'init and fetch repository' \"\n-\tgit svn init $svnrepo &&\n+\tgit svn init \\\"\\$svnrepo\\\" &&\n \tgit svn fetch &&\n \tgit reset --hard git-svn\n \t\"\ndiff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh\nindex e1e8bdf..13081b8 100755\n--- a/t/t9116-git-svn-log.sh\n+++ b/t/t9116-git-svn-log.sh\n@@ -14,9 +14,9 @@ test_expect_success 'setup repository and import' \"\n \t\t\tmkdir -p \\$i && \\\n \t\t\techo hello >> \\$i/README || exit 1\n \t\tdone && \\\n-\t\tsvn import -m test . $svnrepo\n+\t\tsvn import -m test . \\\"\\$svnrepo\\\"\n \t\tcd .. &&\n-\tgit-svn init $svnrepo -T trunk -b branches -t tags &&\n+\tgit-svn init \\\"\\$svnrepo\\\" -T trunk -b branches -t tags &&\n \tgit-svn fetch &&\n \tgit reset --hard trunk &&\n \techo bye >> README &&\ndiff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh\nindex d482b40..c924915 100755\n--- a/t/t9117-git-svn-init-clone.sh\n+++ b/t/t9117-git-svn-init-clone.sh\n@@ -16,13 +16,13 @@ cd tmp\n test_expect_success 'setup svnrepo' \"\n \tmkdir project project/trunk project/branches project/tags &&\n \techo foo > project/trunk/foo &&\n-\tsvn import -m '$test_description' project $svnrepo/project &&\n+\tsvn import -m '$test_description' project \\\"\\$svnrepo\\\"/project &&\n \trm -rf project\n \t\"\n \n test_expect_success 'basic clone' \"\n \ttest ! -d trunk &&\n-\tgit svn clone $svnrepo/project/trunk &&\n+\tgit svn clone \\\"\\$svnrepo\\\"/project/trunk &&\n \ttest -d trunk/.git/svn &&\n \ttest -e trunk/foo &&\n \trm -rf trunk\n@@ -30,7 +30,7 @@ test_expect_success 'basic clone' \"\n \n test_expect_success 'clone to target directory' \"\n \ttest ! -d target &&\n-\tgit svn clone $svnrepo/project/trunk target &&\n+\tgit svn clone \\\"\\$svnrepo\\\"/project/trunk target &&\n \ttest -d target/.git/svn &&\n \ttest -e target/foo &&\n \trm -rf target\n@@ -38,7 +38,7 @@ test_expect_success 'clone to target directory' \"\n \n test_expect_success 'clone with --stdlayout' \"\n \ttest ! -d project &&\n-\tgit svn clone -s $svnrepo/project &&\n+\tgit svn clone -s \\\"\\$svnrepo\\\"/project &&\n \ttest -d project/.git/svn &&\n \ttest -e project/foo &&\n \trm -rf project\n@@ -46,7 +46,7 @@ test_expect_success 'clone with --stdlayout' \"\n \n test_expect_success 'clone to target directory with --stdlayout' \"\n \ttest ! -d target &&\n-\tgit svn clone -s $svnrepo/project target &&\n+\tgit svn clone -s \\\"\\$svnrepo\\\"/project target &&\n \ttest -d target/.git/svn &&\n \ttest -e target/foo &&\n \trm -rf target\ndiff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh\nindex 640bb06..0f107fc 100755\n--- a/t/t9118-git-svn-funky-branch-names.sh\n+++ b/t/t9118-git-svn-funky-branch-names.sh\n@@ -9,17 +9,17 @@ test_description='git-svn funky branch names'\n test_expect_success 'setup svnrepo' \"\n \tmkdir project project/trunk project/branches project/tags &&\n \techo foo > project/trunk/foo &&\n-\tsvn import -m '$test_description' project \\\"$svnrepo/pr ject\\\" &&\n+\tsvn import -m '\\$test_description' project \\\"\\$svnrepo/pr ject\\\" &&\n \trm -rf project &&\n-\tsvn cp -m 'fun' \\\"$svnrepo/pr ject/trunk\\\" \\\n-\t                \\\"$svnrepo/pr ject/branches/fun plugin\\\" &&\n-\tsvn cp -m 'more fun!' \\\"$svnrepo/pr ject/branches/fun plugin\\\" \\\n-\t                      \\\"$svnrepo/pr ject/branches/more fun plugin!\\\" &&\n+\tsvn cp -m 'fun' \\\"\\$svnrepo/pr ject/trunk\\\" \\\n+\t                \\\"\\$svnrepo/pr ject/branches/fun plugin\\\" &&\n+\tsvn cp -m 'more fun!' \\\"\\$svnrepo/pr ject/branches/fun plugin\\\" \\\n+\t                      \\\"\\$svnrepo/pr ject/branches/more fun plugin!\\\" &&\n \tstart_httpd\n \t\"\n \n test_expect_success 'test clone with funky branch names' \"\n-\tgit svn clone -s \\\"$svnrepo/pr ject\\\" project &&\n+\tgit svn clone -s \\\"\\$svnrepo/pr ject\\\" project &&\n \tcd project &&\n \t\tgit rev-parse 'refs/remotes/fun%20plugin' &&\n \t\tgit rev-parse 'refs/remotes/more%20fun%20plugin!' &&\ndiff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh\nindex 9a4eabe..1414c0f 100755\n--- a/t/t9120-git-svn-clone-with-percent-escapes.sh\n+++ b/t/t9120-git-svn-clone-with-percent-escapes.sh\n@@ -9,7 +9,7 @@ test_description='git-svn clone with percent escapes'\n test_expect_success 'setup svnrepo' \"\n \tmkdir project project/trunk project/branches project/tags &&\n \techo foo > project/trunk/foo &&\n-\tsvn import -m '$test_description' project '$svnrepo/pr ject' &&\n+\tsvn import -m \\\"\\$test_description\\\" project \\\"\\$svnrepo/pr ject\\\" &&\n \trm -rf project &&\n \tstart_httpd\n \"\ndiff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\nindex e7b911e..405bad5 100755\n--- a/t/t9500-gitweb-standalone-no-errors.sh\n+++ b/t/t9500-gitweb-standalone-no-errors.sh\n@@ -10,6 +10,7 @@ commandline, and checks that it would not write any errors\n or warnings to log.'\n \n gitweb_init () {\n+\tsafe_pwd=\"$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')\"\n \tcat >gitweb_config.perl <<EOF\n #!/usr/bin/perl\n \n@@ -17,16 +18,16 @@ gitweb_init () {\n \n our \\$version = \"current\";\n our \\$GIT = \"git\";\n-our \\$projectroot = \"$(pwd)\";\n+our \\$projectroot = \"$safe_pwd\";\n our \\$project_maxdepth = 8;\n our \\$home_link_str = \"projects\";\n our \\$site_name = \"[localhost]\";\n our \\$site_header = \"\";\n our \\$site_footer = \"\";\n our \\$home_text = \"indextext.html\";\n-our @stylesheets = (\"file:///$(pwd)/../../gitweb/gitweb.css\");\n-our \\$logo = \"file:///$(pwd)/../../gitweb/git-logo.png\";\n-our \\$favicon = \"file:///$(pwd)/../../gitweb/git-favicon.png\";\n+our @stylesheets = (\"file:///$safe_pwd/../../gitweb/gitweb.css\");\n+our \\$logo = \"file:///$safe_pwd/../../gitweb/git-logo.png\";\n+our \\$favicon = \"file:///$safe_pwd/../../gitweb/git-favicon.png\";\n our \\$projects_list = \"\";\n our \\$export_ok = \"\";\n our \\$strict_export = \"\";\n@@ -53,7 +54,7 @@ gitweb_run () {\n \t# written to web server logs, so we are not interested in that:\n \t# we are interested only in properly formatted errors/warnings\n \trm -f gitweb.log &&\n-\tperl -- $(pwd)/../../gitweb/gitweb.perl \\\n+\tperl -- \"$(pwd)/../../gitweb/gitweb.perl\" \\\n \t\t>/dev/null 2>gitweb.log &&\n \tif grep -q -s \"^[[]\" gitweb.log >/dev/null; then false; else true; fi\n \n-- \n1.5.5.33.gc0a39.dirty\n"},{"id":"74022","messageId":"1207810216-27871-11-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207810216-27871-10-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v2 10/10] Rename the test trash directory to contain shell metacharacters.","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-10T06:50:16Z","receivedAt":"2008-04-10T06:50:16Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"In order to help prevent regressions in the future, rename the trash directory\nfor all tests to contain an assortment of shell metacharacters. This patch\nalso corrects two failures that were caused or exposed by this change.\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/.gitignore                         |    2 +-\n t/t6200-fmt-merge-msg.sh             |    6 +++---\n t/t9121-git-svn-fetch-renamed-dir.sh |   12 ++++++------\n t/test-lib.sh                        |    4 ++--\n 4 files changed, 12 insertions(+), 12 deletions(-)\n\ndiff --git a/t/.gitignore b/t/.gitignore\nindex fad67c0..fd07343 100644\n--- a/t/.gitignore\n+++ b/t/.gitignore\n@@ -1 +1 @@\n-trash\n+/trash directory with characters like $ and \" and ' in its name\ndiff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh\nindex 526d7d1..9c0b926 100755\n--- a/t/t6200-fmt-merge-msg.sh\n+++ b/t/t6200-fmt-merge-msg.sh\n@@ -82,14 +82,14 @@ test_expect_success 'merge-msg test #1' '\n \tgit diff actual expected\n '\n \n-cat >expected <<\\EOF\n-Merge branch 'left' of ../trash\n+cat >expected <<EOF\n+Merge branch 'left' of ../$test\n EOF\n \n test_expect_success 'merge-msg test #2' '\n \n \tgit checkout master &&\n-\tgit fetch ../trash left &&\n+\tgit fetch ../\"$test\" left &&\n \n \tgit fmt-merge-msg <.git/FETCH_HEAD >actual &&\n \tgit diff actual expected\ndiff --git a/t/t9121-git-svn-fetch-renamed-dir.sh b/t/t9121-git-svn-fetch-renamed-dir.sh\nindex 5143ed6..99230b0 100755\n--- a/t/t9121-git-svn-fetch-renamed-dir.sh\n+++ b/t/t9121-git-svn-fetch-renamed-dir.sh\n@@ -7,14 +7,14 @@ test_description='git-svn can fetch renamed directories'\n \n . ./lib-git-svn.sh\n \n-test_expect_success 'load repository with renamed directory' \"\n-\tsvnadmin load -q $rawsvnrepo < ../t9121/renamed-dir.dump\n-\t\"\n+test_expect_success 'load repository with renamed directory' '\n+\tsvnadmin load -q \"$rawsvnrepo\" < ../t9121/renamed-dir.dump\n+\t'\n \n-test_expect_success 'init and fetch repository' \"\n-\tgit svn init $svnrepo/newname &&\n+test_expect_success 'init and fetch repository' '\n+\tgit svn init \"$svnrepo/newname\" &&\n \tgit svn fetch\n-\t\"\n+\t'\n \n test_done\n \ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 04e098b..f6b2954 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -411,14 +411,14 @@ fi\n . ../GIT-BUILD-OPTIONS\n \n # Test repository\n-test=trash\n+test=\"trash directory with characters like \\$ and \\\" and ' in its name\"\n rm -fr \"$test\" || {\n \ttrap - exit\n \techo >&5 \"FATAL: Cannot prepare test area\"\n \texit 1\n }\n \n-test_create_repo $test\n+test_create_repo \"$test\"\n cd \"$test\"\n \n this_test=$(expr \"./$0\" : '.*/\\(t[0-9]*\\)-[^/]*$')\n-- \n1.5.5.33.gc0a39.dirty\n"},{"id":"74032","messageId":"20080410070246.GA27790@shion.is.fushizen.net","threadId":"13032","inReplyTo":"47FDB85F.9070503@viscovery.net","subject":"Re: [PATCH 8/8] Fix tests breaking when checkout path contains shell metacharacters","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-10T07:02:46Z","receivedAt":"2008-04-10T07:02:46Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"On Thu, Apr 10, 2008 at 08:49:03AM +0200, Johannes Sixt wrote:\n> Bryan Donlan schrieb:\n> > To be honest, I fixed all the git-svn tests with a suitably clever vim s///\n> > expression, so at the time this way was actually easier :)\n> \n> Fair enough. If you still have the statement in you vim history, it's\n> worth quoting in the commit message. It's another piece of information\n> that helps reviewing.\n\nIt's fallen off by now, but as I recall it was something along the lines\nof:\n:%s/\\$\\({a number of questionable variable names}\\)/\\\\\"\\\\$\\1\\\\\"/gc\n\nAfter which point I stepped through the matches to confirm that it was\nactually within the test eval strings at the time.\n\nThanks,\n\nBryan\n"},{"id":"74033","messageId":"7vwsn6xjde.fsf@gitster.siamese.dyndns.org","threadId":"13032","inReplyTo":"47FDB85F.9070503@viscovery.net","subject":"Re: [PATCH 8/8] Fix tests breaking when checkout path contains shell metacharacters","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-10T07:24:29Z","receivedAt":"2008-04-10T07:24:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n>>>>  test_expect_success  \".rev_db auto-converted to .rev_map.UUID\" \"\n>>>>  \tgit-svn fetch -i trunk &&\n>>>> +\ttest -z \\\"\\$(ls \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n>>>> +\texpect=\\\"\\$(ls \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_map.*)\\\" &&\n>>>>  \ttest -n \\\"\\$expect\\\" &&\n>>>> +\trev_db=\\\"\\$(echo \\$expect | sed -e 's,_map,_db,')\\\" &&\n>>>> +\tconvert_to_rev_db \\\"\\$expect\\\" \\\"\\$rev_db\\\" &&\n>>>> +\trm -f \\\"\\$expect\\\" &&\n>>>> +\ttest -f \\\"\\$rev_db\\\" &&\n>>>>  \tgit-svn fetch -i trunk &&\n>>>> +\ttest -z \\\"\\$(ls \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n>>>> +\ttest ! -e \\\"\\$GIT_DIR\\\"/svn/trunk/.rev_db &&\n>>>> +\ttest -f \\\"\\$expect\\\"\n>>>>  \t\"\n>>> While looking at this test: Wouldn't it be easier to just place the whole\n>>> thing (and probably similar cases, too) in single-quotes?\n>> \n>> To be honest, I fixed all the git-svn tests with a suitably clever vim s///\n>> expression, so at the time this way was actually easier :)\n\nYeah, last night I ran out of energy reviewing things.  The above is\nsimply too ugly to be acceptable, with or without automated s///\nexpression.\n"},{"id":"74036","messageId":"7vr6dexids.fsf@gitster.siamese.dyndns.org","threadId":"13032","inReplyTo":"1207810216-27871-2-git-send-email-bdonlan@fushizen.net","subject":"Re: [PATCH v2 01/10] git-rebase.sh: Fix --merge --abort failures when path contains whitespace","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-10T07:45:51Z","receivedAt":"2008-04-10T07:45:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bryan Donlan <bdonlan@fushizen.net> writes:\n\n> +### Test that we handle strange characters properly\n\nThanks for the fix and updated tests.\n\n> +work_dir=\"$(pwd)/test \\\" ' \\$ \\\\ dir\"\n> +\n>  test_expect_success setup '\n> +\tmkdir -p \"$work_dir\" &&\n> +\tcd \"$work_dir\" &&\n> +\tgit init &&\n\nAs you know that $work_dir and shell variables in general are available\ninside test_expect_* framework without anything special, like the above\ncode,...\n\n> @@ -27,42 +33,45 @@ testrebase() {\n>  \ttype=$1\n>  \tdotest=$2\n>  \n> +\ttest_expect_success \"rebase$type --abort\" \"\n> +\t\tcd \\\"\\$work_dir\\\" &&\n>  \t\t# Clean up the state from the previous one\n> +\t\tgit reset --hard pre-rebase &&\n> +\t\ttest_must_fail git rebase$type master &&\n> +\t\ttest -d \\\"\\$dotest\\\" &&\n> ...\n\nthis part would become a lot easier to read if you just stayed inside the\noriginal single quoted test script without introducing excessive\nbackslashes.\n\nI am very inclined to replace t3407 with the following.\n\ndiff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh\nindex 37944c3..cadfb23 100755\n--- a/t/t3407-rebase-abort.sh\n+++ b/t/t3407-rebase-abort.sh\n@@ -4,7 +4,13 @@ test_description='git rebase --abort tests'\n \n . ./test-lib.sh\n \n+### Test that we handle strange characters properly\n+work_dir=\"$(pwd)/test \\\" ' \\$ \\\\ dir\"\n+\n test_expect_success setup '\n+\tmkdir -p \"$work_dir\" &&\n+\tcd \"$work_dir\" &&\n+\tgit init &&\n \techo a > a &&\n \tgit add a &&\n \tgit commit -m a &&\n@@ -28,32 +34,35 @@ testrebase() {\n \tdotest=$2\n \n \ttest_expect_success \"rebase$type --abort\" '\n+\t\tcd \"$work_dir\" &&\n \t\t# Clean up the state from the previous one\n-\t\tgit reset --hard pre-rebase\n-\t\ttest_must_fail git rebase'\"$type\"' master &&\n-\t\ttest -d '$dotest' &&\n+\t\tgit reset --hard pre-rebase &&\n+\t\ttest_must_fail git rebase$type master &&\n+\t\ttest -d \"$dotest\" &&\n \t\tgit rebase --abort &&\n \t\ttest $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&\n-\t\ttest ! -d '$dotest'\n+\t\ttest ! -d \"$dotest\"\n \t'\n \n \ttest_expect_success \"rebase$type --abort after --skip\" '\n+\t\tcd \"$work_dir\" &&\n \t\t# Clean up the state from the previous one\n-\t\tgit reset --hard pre-rebase\n-\t\ttest_must_fail git rebase'\"$type\"' master &&\n-\t\ttest -d '$dotest' &&\n+\t\tgit reset --hard pre-rebase &&\n+\t\ttest_must_fail git rebase$type master &&\n+\t\ttest -d \"$dotest\" &&\n \t\ttest_must_fail git rebase --skip &&\n \t\ttest $(git rev-parse HEAD) = $(git rev-parse master) &&\n \t\tgit-rebase --abort &&\n \t\ttest $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&\n-\t\ttest ! -d '$dotest'\n+\t\ttest ! -d \"$dotest\"\n \t'\n \n \ttest_expect_success \"rebase$type --abort after --continue\" '\n+\t\tcd \"$work_dir\" &&\n \t\t# Clean up the state from the previous one\n-\t\tgit reset --hard pre-rebase\n-\t\ttest_must_fail git rebase'\"$type\"' master &&\n-\t\ttest -d '$dotest' &&\n+\t\tgit reset --hard pre-rebase &&\n+\t\ttest_must_fail git rebase$type master &&\n+\t\ttest -d \"$dotest\" &&\n \t\techo c > a &&\n \t\techo d >> a &&\n \t\tgit add a &&\n@@ -61,7 +70,7 @@ testrebase() {\n \t\ttest $(git rev-parse HEAD) != $(git rev-parse master) &&\n \t\tgit rebase --abort &&\n \t\ttest $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&\n-\t\ttest ! -d '$dotest'\n+\t\ttest ! -d \"$dotest\"\n \t'\n }\n \n"},{"id":"74046","messageId":"20080410084820.GA1904@shion.is.fushizen.net","threadId":"13032","inReplyTo":"7vr6dexids.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH v2 01/10] git-rebase.sh: Fix --merge --abort failures when path contains whitespace","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-04-10T08:48:20Z","receivedAt":"2008-04-10T08:48:20Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"On Thu, Apr 10, 2008 at 12:45:51AM -0700, Junio C Hamano wrote:\n> Bryan Donlan <bdonlan@fushizen.net> writes:\n[snip]\n> > +\ttest_expect_success \"rebase$type --abort\" \"\n> > +\t\tcd \\\"\\$work_dir\\\" &&\n> >  \t\t# Clean up the state from the previous one\n> > +\t\tgit reset --hard pre-rebase &&\n> > +\t\ttest_must_fail git rebase$type master &&\n> > +\t\ttest -d \\\"\\$dotest\\\" &&\n> > ...\n> \n> this part would become a lot easier to read if you just stayed inside the\n> original single quoted test script without introducing excessive\n> backslashes.\n\nOh, wow, what was I thinking? I'll fix that up... it must've been rather\nlate at night when I wrote that or something :)\n\nAlso, I saw your note about changing the git-svn tests to single-quoting\nrather than escaping everywhere - but only after I hit send. I'll roll\nthat into the v3 (and probably wait longer than this time, so people\nhave time to finish reviewing...)\n\nThanks,\n\nBryan\n"},{"id":"74153","messageId":"7vfxtsow65.fsf@gitster.siamese.dyndns.org","threadId":"13032","inReplyTo":"7vr6dexids.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH v2 01/10] git-rebase.sh: Fix --merge --abort failures when path contains whitespace","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-11T22:37:22Z","receivedAt":"2008-04-11T22:37:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I am very inclined to replace t3407 with the following.\n>\n> diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh\n> index 37944c3..cadfb23 100755\n> --- a/t/t3407-rebase-abort.sh\n> +++ b/t/t3407-rebase-abort.sh\n> @@ -4,7 +4,13 @@ test_description='git rebase --abort tests'\n>  \n>  . ./test-lib.sh\n>  \n> +### Test that we handle strange characters properly\n> +work_dir=\"$(pwd)/test \\\" ' \\$ \\\\ dir\"\n> +\n\nEh, I am sorry, but a slight change of plans.  We would probably want to\nexclude backslash from the above, so that we do not get inconsistent test\nbetween DOSsy systems and others.\n\nI think your \"trash directory\" is a reasonable way to test a very common\nissue.  SP is not all that unusual character to use in a pathname,\nespecially created from within a GUI-ish environment.  So probably we\ncan do something similar here, like:\n\n\twork_dir=\"$(pwd)/test dir\"\n"},{"id":"75980","messageId":"1209879480-16910-1-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1207810216-27871-1-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v3 00/10] Fix git's test suite to pass when the path contains spaces","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-05-04T05:37:50Z","receivedAt":"2008-05-04T05:37:50Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"This patch series fixes bugs in git and git's testsuite to allow all tests\nto pass when the working directory contains whitespace and/or shell\nmetacharacters.\n\nThe first three patches in this series fix bugs in git itself that were\nuncovered in the process of fixing the test suite. Each contains additional\ntests and/or updates to existing tests to exercise the bug in question.\n\nPatches 4 and 5 set up an abstraction for safe handling of editor variables\nin tests when we have odd paths; and 6-7 fix bugs in the test libraries.\nPatch 8 cleans up some instances of the unportable export FOO=bar construct\nin the test suite; patch 9 fixes the remaining individual tests to be\nspace-sane, and finally 10 arranges for the test suite to always run with the\ntrash directory name containing spaces, to help prevent regressions in the\nfuture.\n\nSignificant changes since v2:\n  * Use only spaces in the trash dir names for Windows compatibility\n  * Avoid ugliness like \\\"\\$GIT_DIR\\\"\n\nThis series is also available by:\n  git pull git://repo.or.cz/git/bdonlan.git wst-submit3\n\nSorry for the long delay in updating the series; I've been consumed with\nschoolwork lately :)\n\nSince it was mentioned providing conversion scripts was useful in review, here\nis a hacky script I put together to help fixup the quotation:\n\nhttp://fushizen.net/~bd/requote.pl\n\nThis script was applied on t/t*svn*.sh, then followed by a few manual fixes,\nreview, and git add -i to change only the chunks that I had made worse in the\nprevious patches. Note however that the conversion of \"->' in places makes for\na large diff...\n\nBryan Donlan (10):\n  git-rebase.sh: Fix --merge --abort failures when path contains\n    whitespace\n  config.c: Escape backslashes in section names properly\n  git-send-email.perl: Handle shell metacharacters in $EDITOR properly\n  test-lib.sh: Add a test_set_editor function to safely set $VISUAL\n  Use test_set_editor in t9001-send-email.sh\n  test-lib.sh: Fix some missing path quoting\n  lib-git-svn.sh: Fix quoting issues with paths containing shell\n    metacharacters\n  Don't use the export NAME=value form in the test scripts.\n  Fix tests breaking when checkout path contains shell metacharacters\n  Rename the test trash directory to contain spaces.\n\n config.c                                      |    2 +-\n git-rebase.sh                                 |    2 +-\n git-send-email.perl                           |    2 +-\n t/.gitignore                                  |    2 +-\n t/lib-git-svn.sh                              |    3 +-\n t/lib-httpd.sh                                |    3 +-\n t/t0000-basic.sh                              |    4 +-\n t/t1020-subdirectory.sh                       |   22 ++--\n t/t1303-wacky-config.sh                       |    6 +\n t/t1500-rev-parse.sh                          |    9 +-\n t/t1501-worktree.sh                           |   34 +++---\n t/t3050-subprojects-fetch.sh                  |    2 +-\n t/t3400-rebase.sh                             |    3 +-\n t/t3404-rebase-interactive.sh                 |    3 +-\n t/t3407-rebase-abort.sh                       |   33 +++--\n t/t3500-cherry.sh                             |    3 +-\n t/t5500-fetch-pack.sh                         |    4 +-\n t/t5512-ls-remote.sh                          |    2 +-\n t/t5516-fetch-push.sh                         |    6 +-\n t/t5700-clone-reference.sh                    |    2 +-\n t/t5710-info-alternate.sh                     |    4 +-\n t/t6000lib.sh                                 |    9 +-\n t/t6010-merge-base.sh                         |    9 +-\n t/t6200-fmt-merge-msg.sh                      |    6 +-\n t/t7003-filter-branch.sh                      |    2 +-\n t/t7004-tag.sh                                |    3 +-\n t/t7010-setup.sh                              |    2 +-\n t/t7300-clean.sh                              |    2 +-\n t/t7501-commit.sh                             |    8 +-\n t/t7504-commit-msg-hook.sh                    |   23 ++--\n t/t7505-prepare-commit-msg-hook.sh            |   17 ++-\n t/t9001-send-email.sh                         |    5 +-\n t/t9100-git-svn-basic.sh                      |  120 +++++++++---------\n t/t9101-git-svn-props.sh                      |    8 +-\n t/t9102-git-svn-deep-rmdir.sh                 |   20 ++--\n t/t9103-git-svn-tracked-directory-removed.sh  |   20 ++--\n t/t9104-git-svn-follow-parent.sh              |  172 ++++++++++++------------\n t/t9105-git-svn-commit-diff.sh                |   32 +++---\n t/t9106-git-svn-commit-diff-clobber.sh        |   56 ++++----\n t/t9106-git-svn-dcommit-clobber-series.sh     |   30 ++--\n t/t9107-git-svn-migrate.sh                    |  124 +++++++++---------\n t/t9108-git-svn-glob.sh                       |   76 ++++++------\n t/t9110-git-svn-use-svm-props.sh              |   12 +-\n t/t9111-git-svn-use-svnsync-props.sh          |   12 +-\n t/t9112-git-svn-md5less-file.sh               |    4 +-\n t/t9113-git-svn-dcommit-new-file.sh           |   10 +-\n t/t9114-git-svn-dcommit-merge.sh              |   22 ++--\n t/t9115-git-svn-dcommit-funky-renames.sh      |   12 +-\n t/t9116-git-svn-log.sh                        |   12 +-\n t/t9117-git-svn-init-clone.sh                 |   30 ++--\n t/t9118-git-svn-funky-branch-names.sh         |   24 ++--\n t/t9120-git-svn-clone-with-percent-escapes.sh |    6 +-\n t/t9121-git-svn-fetch-renamed-dir.sh          |   12 +-\n t/t9500-gitweb-standalone-no-errors.sh        |   25 ++--\n t/test-lib.sh                                 |   22 +++-\n 55 files changed, 575 insertions(+), 523 deletions(-)\n"},{"id":"75986","messageId":"1209879480-16910-2-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1209879480-16910-1-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v3 01/10] git-rebase.sh: Fix --merge --abort failures when path contains whitespace","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-05-04T05:37:51Z","receivedAt":"2008-05-04T05:37:51Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"Also update t/t3407-rebase-abort.sh to exercise the bug\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n git-rebase.sh           |    2 +-\n t/t3407-rebase-abort.sh |   33 +++++++++++++++++++++------------\n 2 files changed, 22 insertions(+), 13 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 9b13b83..c43afe5 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -214,7 +214,7 @@ do\n \t\telse\n \t\t\tdie \"No rebase in progress?\"\n \t\tfi\n-\t\tgit reset --hard $(cat $dotest/orig-head)\n+\t\tgit reset --hard $(cat \"$dotest/orig-head\")\n \t\trm -r \"$dotest\"\n \t\texit\n \t\t;;\ndiff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh\nindex 37944c3..1777ffe 100755\n--- a/t/t3407-rebase-abort.sh\n+++ b/t/t3407-rebase-abort.sh\n@@ -4,7 +4,13 @@ test_description='git rebase --abort tests'\n \n . ./test-lib.sh\n \n+### Test that we handle space characters properly\n+work_dir=\"$(pwd)/test dir\"\n+\n test_expect_success setup '\n+\tmkdir -p \"$work_dir\" &&\n+\tcd \"$work_dir\" &&\n+\tgit init &&\n \techo a > a &&\n \tgit add a &&\n \tgit commit -m a &&\n@@ -28,32 +34,35 @@ testrebase() {\n \tdotest=$2\n \n \ttest_expect_success \"rebase$type --abort\" '\n+\t\tcd \"$work_dir\" &&\n \t\t# Clean up the state from the previous one\n-\t\tgit reset --hard pre-rebase\n-\t\ttest_must_fail git rebase'\"$type\"' master &&\n-\t\ttest -d '$dotest' &&\n+\t\tgit reset --hard pre-rebase &&\n+\t\ttest_must_fail git rebase$type master &&\n+\t\ttest -d \"$dotest\" &&\n \t\tgit rebase --abort &&\n \t\ttest $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&\n-\t\ttest ! -d '$dotest'\n+\t\ttest ! -d \"$dotest\"\n \t'\n \n \ttest_expect_success \"rebase$type --abort after --skip\" '\n+\t\tcd \"$work_dir\" &&\n \t\t# Clean up the state from the previous one\n-\t\tgit reset --hard pre-rebase\n-\t\ttest_must_fail git rebase'\"$type\"' master &&\n-\t\ttest -d '$dotest' &&\n+\t\tgit reset --hard pre-rebase &&\n+\t\ttest_must_fail git rebase$type master &&\n+\t\ttest -d \"$dotest\" &&\n \t\ttest_must_fail git rebase --skip &&\n \t\ttest $(git rev-parse HEAD) = $(git rev-parse master) &&\n \t\tgit-rebase --abort &&\n \t\ttest $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&\n-\t\ttest ! -d '$dotest'\n+\t\ttest ! -d \"$dotest\"\n \t'\n \n \ttest_expect_success \"rebase$type --abort after --continue\" '\n+\t\tcd \"$work_dir\" &&\n \t\t# Clean up the state from the previous one\n-\t\tgit reset --hard pre-rebase\n-\t\ttest_must_fail git rebase'\"$type\"' master &&\n-\t\ttest -d '$dotest' &&\n+\t\tgit reset --hard pre-rebase &&\n+\t\ttest_must_fail git rebase$type master &&\n+\t\ttest -d \"$dotest\" &&\n \t\techo c > a &&\n \t\techo d >> a &&\n \t\tgit add a &&\n@@ -61,7 +70,7 @@ testrebase() {\n \t\ttest $(git rev-parse HEAD) != $(git rev-parse master) &&\n \t\tgit rebase --abort &&\n \t\ttest $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&\n-\t\ttest ! -d '$dotest'\n+\t\ttest ! -d \"$dotest\"\n \t'\n }\n \n-- \n1.5.5.1.128.g03a943\n"},{"id":"75987","messageId":"1209879480-16910-3-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1209879480-16910-2-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v3 02/10] config.c: Escape backslashes in section names properly","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-05-04T05:37:52Z","receivedAt":"2008-05-04T05:37:52Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"If an element of the configuration key name other than the first or last\ncontains a backslash, it is not escaped on output, but is treated as an escape\nsequence on input. Thus, the backslash is lost when re-loading the\nconfiguration.\n\nThis patch corrects this by having backslashes escaped properly, and\nintroduces a new test for this bug.\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n config.c                |    2 +-\n t/t1303-wacky-config.sh |    6 ++++++\n 2 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/config.c b/config.c\nindex b0ada51..f0ac456 100644\n--- a/config.c\n+++ b/config.c\n@@ -680,7 +680,7 @@ static int store_write_section(int fd, const char* key)\n \tif (dot) {\n \t\tstrbuf_addf(&sb, \"[%.*s \\\"\", (int)(dot - key), key);\n \t\tfor (i = dot - key + 1; i < store.baselen; i++) {\n-\t\t\tif (key[i] == '\"')\n+\t\t\tif (key[i] == '\"' || key[i] == '\\\\')\n \t\t\t\tstrbuf_addch(&sb, '\\\\');\n \t\t\tstrbuf_addch(&sb, key[i]);\n \t\t}\ndiff --git a/t/t1303-wacky-config.sh b/t/t1303-wacky-config.sh\nindex 99985dc..f366b53 100755\n--- a/t/t1303-wacky-config.sh\n+++ b/t/t1303-wacky-config.sh\n@@ -34,4 +34,10 @@ test_expect_success 'add key in different section' '\n \tcheck section2.key bar\n '\n \n+SECTION=\"test.q\\\"s\\\\sq'sp e.key\"\n+test_expect_success 'make sure git-config escapes section names properly' '\n+\tgit config \"$SECTION\" bar &&\n+\tcheck \"$SECTION\" bar\n+'\n+\n test_done\n-- \n1.5.5.1.128.g03a943\n"},{"id":"75984","messageId":"1209879480-16910-4-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1209879480-16910-3-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v3 03/10] git-send-email.perl: Handle shell metacharacters in $EDITOR properly","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-05-04T05:37:53Z","receivedAt":"2008-05-04T05:37:53Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"This fixes the git-send-perl semantics for launching an editor when\n$GIT_EDITOR (or friends) contains shell metacharacters to match\nlaunch_editor() in builtin-tag.c. If we use the current approach\n(sh -c '$0 $@' \"$EDITOR\" files ...), we see it fails when $EDITOR has\nshell metacharacters:\n\n$ sh -x -c '$0 $@' \"$VISUAL\" \"foo\"\n+ \"$FAKE_EDITOR\" foo\n\"$FAKE_EDITOR\": 1: \"$FAKE_EDITOR\": not found\n\nWhereas builtin-tag.c will invoke sh -c \"$EDITOR \\\"$@\\\"\".\n\nThus, this patch changes git-send-email.perl to use the same method as the\nC utilities, and additionally updates t/t9001-send-email.sh to test for this bug.\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n git-send-email.perl   |    2 +-\n t/t9001-send-email.sh |    8 ++++++--\n 2 files changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 9e568bf..b502396 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -512,7 +512,7 @@ EOT\n \tclose(C);\n \n \tmy $editor = $ENV{GIT_EDITOR} || Git::config(@repo, \"core.editor\") || $ENV{VISUAL} || $ENV{EDITOR} || \"vi\";\n-\tsystem('sh', '-c', '$0 $@', $editor, $compose_filename);\n+\tsystem('sh', '-c', $editor.' \"$@\"', $editor, $compose_filename);\n \n \topen(C2,\">\",$compose_filename . \".final\")\n \t\tor die \"Failed to open $compose_filename.final : \" . $!;\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex c0973b4..030f66c 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -139,15 +139,19 @@ test_expect_success 'Valid In-Reply-To when prompting' '\n \n test_expect_success 'setup fake editor' '\n \t(echo \"#!/bin/sh\" &&\n-\t echo \"echo fake edit >>\\$1\"\n+\t echo \"echo fake edit >>\\\"\\$1\\\"\"\n \t) >fake-editor &&\n \tchmod +x fake-editor\n '\n \n+FAKE_EDITOR=\"$(pwd)/fake-editor\"\n+export FAKE_EDITOR\n+GIT_EDITOR='\"$FAKE_EDITOR\"'\n+export GIT_EDITOR\n+\n test_expect_success '--compose works' '\n \tclean_fake_sendmail &&\n \techo y | \\\n-\t\tGIT_EDITOR=$(pwd)/fake-editor \\\n \t\tGIT_SEND_EMAIL_NOTTY=1 \\\n \t\tgit send-email \\\n \t\t--compose --subject foo \\\n-- \n1.5.5.1.128.g03a943\n"},{"id":"75982","messageId":"1209879480-16910-5-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1209879480-16910-4-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v3 04/10] test-lib.sh: Add a test_set_editor function to safely set $VISUAL","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-05-04T05:37:54Z","receivedAt":"2008-05-04T05:37:54Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"In particular, this function correctly handles cases where the pwd contains\nspaces, quotes, and other troublesome metacharacters.\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/test-lib.sh |   16 ++++++++++++++++\n 1 files changed, 16 insertions(+), 0 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 7c2a8ba..d7ad13b 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -160,6 +160,22 @@ die () {\n \n trap 'die' exit\n \n+# The semantics of the editor variables are that of invoking\n+# sh -c \"$EDITOR \\\"$@\\\"\" files ...\n+#\n+# If our trash directory contains shell metacharacters, they will be\n+# interpreted if we just set $EDITOR directly, so do a little dance with\n+# environment variables to work around this.\n+#\n+# In particular, quoting isn't enough, as the path may contain the same quote\n+# that we're using. \n+test_set_editor () {\n+\tFAKE_EDITOR=\"$1\"\n+\texport FAKE_EDITOR\n+\tVISUAL='\"$FAKE_EDITOR\"'\n+\texport VISUAL\n+}\n+\n test_tick () {\n \tif test -z \"${test_tick+set}\"\n \tthen\n-- \n1.5.5.1.128.g03a943\n"},{"id":"75985","messageId":"1209879480-16910-6-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1209879480-16910-5-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v3 05/10] Use test_set_editor in t9001-send-email.sh","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-05-04T05:37:55Z","receivedAt":"2008-05-04T05:37:55Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/t9001-send-email.sh |    5 +----\n 1 files changed, 1 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex 030f66c..0a65785 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -144,10 +144,7 @@ test_expect_success 'setup fake editor' '\n \tchmod +x fake-editor\n '\n \n-FAKE_EDITOR=\"$(pwd)/fake-editor\"\n-export FAKE_EDITOR\n-GIT_EDITOR='\"$FAKE_EDITOR\"'\n-export GIT_EDITOR\n+test_set_editor \"$(pwd)/fake-editor\"\n \n test_expect_success '--compose works' '\n \tclean_fake_sendmail &&\n-- \n1.5.5.1.128.g03a943\n"},{"id":"75978","messageId":"1209879480-16910-7-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1209879480-16910-6-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v3 06/10] test-lib.sh: Fix some missing path quoting","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-05-04T05:37:56Z","receivedAt":"2008-05-04T05:37:56Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/test-lib.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex d7ad13b..04e098b 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -345,7 +345,7 @@ test_create_repo () {\n \trepo=\"$1\"\n \tmkdir \"$repo\"\n \tcd \"$repo\" || error \"Cannot setup test environment\"\n-\t\"$GIT_EXEC_PATH/git\" init --template=$GIT_EXEC_PATH/templates/blt/ >/dev/null 2>&1 ||\n+\t\"$GIT_EXEC_PATH/git\" init \"--template=$GIT_EXEC_PATH/templates/blt/\" >/dev/null 2>&1 ||\n \terror \"cannot run git init -- have you built things yet?\"\n \tmv .git/hooks .git/hooks-disabled\n \tcd \"$owd\"\n-- \n1.5.5.1.128.g03a943\n"},{"id":"75979","messageId":"1209879480-16910-8-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1209879480-16910-7-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v3 07/10] lib-git-svn.sh: Fix quoting issues with paths containing shell metacharacters","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-05-04T05:37:57Z","receivedAt":"2008-05-04T05:37:57Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/lib-git-svn.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex 9decd2e..445df78 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -20,12 +20,13 @@ then\n fi\n \n svnrepo=$PWD/svnrepo\n+export svnrepo\n \n perl -w -e \"\n use SVN::Core;\n use SVN::Repos;\n \\$SVN::Core::VERSION gt '1.1.0' or exit(42);\n-system(qw/svnadmin create --fs-type fsfs/, '$svnrepo') == 0 or exit(41);\n+system(qw/svnadmin create --fs-type fsfs/, \\$ENV{svnrepo}) == 0 or exit(41);\n \" >&3 2>&4\n x=$?\n if test $x -ne 0\n-- \n1.5.5.1.128.g03a943\n"},{"id":"75988","messageId":"1209879480-16910-9-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1209879480-16910-8-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v3 08/10] Don't use the export NAME=value form in the test scripts.","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-05-04T05:37:58Z","receivedAt":"2008-05-04T05:37:58Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"This form is not portable across all shells, so replace instances of:\n\n  export FOO=bar\n\nwith:\n\n  FOO=bar\n  export FOO\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/lib-httpd.sh                         |    3 +-\n t/t1500-rev-parse.sh                   |    9 ++++---\n t/t1501-worktree.sh                    |   34 ++++++++++++++++---------------\n t/t3400-rebase.sh                      |    3 +-\n t/t3500-cherry.sh                      |    3 +-\n t/t5500-fetch-pack.sh                  |    2 +-\n t/t6000lib.sh                          |    9 +++++--\n t/t6010-merge-base.sh                  |    9 ++++---\n t/t7004-tag.sh                         |    3 +-\n t/t9500-gitweb-standalone-no-errors.sh |   16 ++++++++------\n 10 files changed, 52 insertions(+), 39 deletions(-)\n\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nindex 7f206c5..a5c4436 100644\n--- a/t/lib-httpd.sh\n+++ b/t/lib-httpd.sh\n@@ -61,7 +61,8 @@ prepare_httpd() {\n \t\t\t-new -x509 -nodes \\\n \t\t\t-out $HTTPD_ROOT_PATH/httpd.pem \\\n \t\t\t-keyout $HTTPD_ROOT_PATH/httpd.pem\n-\t\texport GIT_SSL_NO_VERIFY=t\n+\t\tGIT_SSL_NO_VERIFY=t\n+\t\texport GIT_SSL_NO_VERIFY\n \t\tHTTPD_PARA=\"$HTTPD_PARA -DSSL\"\n \telse\n \t\tHTTPD_URL=http://127.0.0.1:$LIB_HTTPD_PORT\ndiff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh\nindex 38a2bf0..85da4ca 100755\n--- a/t/t1500-rev-parse.sh\n+++ b/t/t1500-rev-parse.sh\n@@ -51,8 +51,9 @@ test_rev_parse 'core.bare undefined' false false true\n \n mkdir work || exit 1\n cd work || exit 1\n-export GIT_DIR=../.git\n-export GIT_CONFIG=\"$(pwd)\"/../.git/config\n+GIT_DIR=../.git\n+GIT_CONFIG=\"$(pwd)\"/../.git/config\n+export GIT_DIR GIT_CONFIG\n \n git config core.bare false\n test_rev_parse 'GIT_DIR=../.git, core.bare = false' false false true ''\n@@ -64,8 +65,8 @@ git config --unset core.bare\n test_rev_parse 'GIT_DIR=../.git, core.bare undefined' false false true ''\n \n mv ../.git ../repo.git || exit 1\n-export GIT_DIR=../repo.git\n-export GIT_CONFIG=\"$(pwd)\"/../repo.git/config\n+GIT_DIR=../repo.git\n+GIT_CONFIG=\"$(pwd)\"/../repo.git/config\n \n git config core.bare false\n test_rev_parse 'GIT_DIR=../repo.git, core.bare = false' false false true ''\ndiff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh\nindex 7ee3820..2ee88d8 100755\n--- a/t/t1501-worktree.sh\n+++ b/t/t1501-worktree.sh\n@@ -32,24 +32,25 @@ mkdir -p work/sub/dir || exit 1\n mv .git repo.git || exit 1\n \n say \"core.worktree = relative path\"\n-export GIT_DIR=repo.git\n-export GIT_CONFIG=\"$(pwd)\"/$GIT_DIR/config\n+GIT_DIR=repo.git\n+GIT_CONFIG=\"$(pwd)\"/$GIT_DIR/config\n+export GIT_DIR GIT_CONFIG\n unset GIT_WORK_TREE\n git config core.worktree ../work\n test_rev_parse 'outside'      false false false\n cd work || exit 1\n-export GIT_DIR=../repo.git\n-export GIT_CONFIG=\"$(pwd)\"/$GIT_DIR/config\n+GIT_DIR=../repo.git\n+GIT_CONFIG=\"$(pwd)\"/$GIT_DIR/config\n test_rev_parse 'inside'       false false true ''\n cd sub/dir || exit 1\n-export GIT_DIR=../../../repo.git\n-export GIT_CONFIG=\"$(pwd)\"/$GIT_DIR/config\n+GIT_DIR=../../../repo.git\n+GIT_CONFIG=\"$(pwd)\"/$GIT_DIR/config\n test_rev_parse 'subdirectory' false false true sub/dir/\n cd ../../.. || exit 1\n \n say \"core.worktree = absolute path\"\n-export GIT_DIR=$(pwd)/repo.git\n-export GIT_CONFIG=$GIT_DIR/config\n+GIT_DIR=$(pwd)/repo.git\n+GIT_CONFIG=$GIT_DIR/config\n git config core.worktree \"$(pwd)/work\"\n test_rev_parse 'outside'      false false false\n cd work || exit 1\n@@ -59,25 +60,26 @@ test_rev_parse 'subdirectory' false false true sub/dir/\n cd ../../.. || exit 1\n \n say \"GIT_WORK_TREE=relative path (override core.worktree)\"\n-export GIT_DIR=$(pwd)/repo.git\n-export GIT_CONFIG=$GIT_DIR/config\n+GIT_DIR=$(pwd)/repo.git\n+GIT_CONFIG=$GIT_DIR/config\n git config core.worktree non-existent\n-export GIT_WORK_TREE=work\n+GIT_WORK_TREE=work\n+export GIT_WORK_TREE\n test_rev_parse 'outside'      false false false\n cd work || exit 1\n-export GIT_WORK_TREE=.\n+GIT_WORK_TREE=.\n test_rev_parse 'inside'       false false true ''\n cd sub/dir || exit 1\n-export GIT_WORK_TREE=../..\n+GIT_WORK_TREE=../..\n test_rev_parse 'subdirectory' false false true sub/dir/\n cd ../../.. || exit 1\n \n mv work repo.git/work\n \n say \"GIT_WORK_TREE=absolute path, work tree below git dir\"\n-export GIT_DIR=$(pwd)/repo.git\n-export GIT_CONFIG=$GIT_DIR/config\n-export GIT_WORK_TREE=$(pwd)/repo.git/work\n+GIT_DIR=$(pwd)/repo.git\n+GIT_CONFIG=$GIT_DIR/config\n+GIT_WORK_TREE=$(pwd)/repo.git/work\n test_rev_parse 'outside'              false false false\n cd repo.git || exit 1\n test_rev_parse 'in repo.git'              false true  false\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 496f4ec..10d7449 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -9,7 +9,8 @@ This test runs git rebase and checks that the author information is not lost.\n '\n . ./test-lib.sh\n \n-export GIT_AUTHOR_EMAIL=bogus_email_address\n+GIT_AUTHOR_EMAIL=bogus_email_address\n+export GIT_AUTHOR_EMAIL\n \n test_expect_success \\\n     'prepare repository with topic branches' \\\ndiff --git a/t/t3500-cherry.sh b/t/t3500-cherry.sh\nindex d0a440f..4911c48 100755\n--- a/t/t3500-cherry.sh\n+++ b/t/t3500-cherry.sh\n@@ -10,7 +10,8 @@ checks that git cherry only returns the second patch in the local branch\n '\n . ./test-lib.sh\n \n-export GIT_AUTHOR_EMAIL=bogus_email_address\n+GIT_AUTHOR_EMAIL=bogus_email_address\n+export GIT_AUTHOR_EMAIL\n \n test_expect_success \\\n     'prepare repository with topic branch, and check cherry finds the 2 patches from there' \\\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 788b4a5..1700d07 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -31,7 +31,7 @@ add () {\n \tsec=$(($sec+1))\n \tcommit=$(echo \"$text\" | GIT_AUTHOR_DATE=$sec \\\n \t\tgit commit-tree $tree $parents 2>>log2.txt)\n-\texport $name=$commit\n+\teval \"$name=$commit; export $name\"\n \techo $commit > .git/refs/heads/$branch\n \teval ${branch}TIP=$commit\n }\ndiff --git a/t/t6000lib.sh b/t/t6000lib.sh\nindex c0baaa5..f55627b 100755\n--- a/t/t6000lib.sh\n+++ b/t/t6000lib.sh\n@@ -49,13 +49,15 @@ as_author()\n \tshift 1\n         _save=$GIT_AUTHOR_EMAIL\n \n-\texport GIT_AUTHOR_EMAIL=\"$_author\"\n+\tGIT_AUTHOR_EMAIL=\"$_author\"\n+\texport GIT_AUTHOR_EMAIL\n \t\"$@\"\n \tif test -z \"$_save\"\n \tthen\n \t\tunset GIT_AUTHOR_EMAIL\n \telse\n-\t\texport GIT_AUTHOR_EMAIL=\"$_save\"\n+\t\tGIT_AUTHOR_EMAIL=\"$_save\"\n+\t\texport GIT_AUTHOR_EMAIL\n \tfi\n }\n \n@@ -69,7 +71,8 @@ on_committer_date()\n {\n     _date=$1\n     shift 1\n-    export GIT_COMMITTER_DATE=\"$_date\"\n+    GIT_COMMITTER_DATE=\"$_date\"\n+    export GIT_COMMITTER_DATE\n     \"$@\"\n     unset GIT_COMMITTER_DATE\n }\ndiff --git a/t/t6010-merge-base.sh b/t/t6010-merge-base.sh\nindex 96f3d35..b6e57b2 100755\n--- a/t/t6010-merge-base.sh\n+++ b/t/t6010-merge-base.sh\n@@ -13,10 +13,11 @@ T=$(git write-tree)\n M=1130000000\n Z=+0000\n \n-export GIT_COMMITTER_EMAIL=git@comm.iter.xz\n-export GIT_COMMITTER_NAME='C O Mmiter'\n-export GIT_AUTHOR_NAME='A U Thor'\n-export GIT_AUTHOR_EMAIL=git@au.thor.xz\n+GIT_COMMITTER_EMAIL=git@comm.iter.xz\n+GIT_COMMITTER_NAME='C O Mmiter'\n+GIT_AUTHOR_NAME='A U Thor'\n+GIT_AUTHOR_EMAIL=git@au.thor.xz\n+export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL\n \n doit() {\n \tOFFSET=$1; shift\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 1a7141e..2dcee7c 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -626,7 +626,8 @@ esac\n \n cp -R ../t7004 ./gpghome\n chmod 0700 gpghome\n-export GNUPGHOME=\"$(pwd)/gpghome\"\n+GNUPGHOME=\"$(pwd)/gpghome\"\n+export GNUPGHOME\n \n get_tag_header signed-tag $commit commit $time >expect\n echo 'A signed tag message' >>expect\ndiff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\nindex 061a259..3dc261d 100755\n--- a/t/t9500-gitweb-standalone-no-errors.sh\n+++ b/t/t9500-gitweb-standalone-no-errors.sh\n@@ -39,13 +39,15 @@ EOF\n }\n \n gitweb_run () {\n-\texport GATEWAY_INTERFACE=\"CGI/1.1\"\n-\texport HTTP_ACCEPT=\"*/*\"\n-\texport REQUEST_METHOD=\"GET\"\n-\texport QUERY_STRING=\"\"$1\"\"\n-\texport PATH_INFO=\"\"$2\"\"\n-\n-\texport GITWEB_CONFIG=$(pwd)/gitweb_config.perl\n+\tGATEWAY_INTERFACE=\"CGI/1.1\"\n+\tHTTP_ACCEPT=\"*/*\"\n+\tREQUEST_METHOD=\"GET\"\n+\tQUERY_STRING=\"\"$1\"\"\n+\tPATH_INFO=\"\"$2\"\"\n+\texport GATEWAY_INTERFACE HTTP_ACCEPT REQUEST_METHOD QUERY_STRING PATH_INFO\n+\n+\tGITWEB_CONFIG=$(pwd)/gitweb_config.perl\n+\texport GITWEB_CONFIG\n \n \t# some of git commands write to STDERR on error, but this is not\n \t# written to web server logs, so we are not interested in that:\n-- \n1.5.5.1.128.g03a943\n"},{"id":"75983","messageId":"1209879480-16910-10-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1209879480-16910-9-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v3 09/10] Fix tests breaking when checkout path contains shell metacharacters","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-05-04T05:37:59Z","receivedAt":"2008-05-04T05:37:59Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"This fixes the remainder of the issues where the test script itself is at\nfault for failing when the git checkout path contains whitespace or other\nshell metacharacters.\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/t0000-basic.sh                              |    4 +-\n t/t1020-subdirectory.sh                       |   22 ++--\n t/t3050-subprojects-fetch.sh                  |    2 +-\n t/t3404-rebase-interactive.sh                 |    3 +-\n t/t5500-fetch-pack.sh                         |    2 +-\n t/t5512-ls-remote.sh                          |    2 +-\n t/t5516-fetch-push.sh                         |    6 +-\n t/t5700-clone-reference.sh                    |    2 +-\n t/t5710-info-alternate.sh                     |    4 +-\n t/t7003-filter-branch.sh                      |    2 +-\n t/t7010-setup.sh                              |    2 +-\n t/t7300-clean.sh                              |    2 +-\n t/t7501-commit.sh                             |    8 +-\n t/t7504-commit-msg-hook.sh                    |   23 ++--\n t/t7505-prepare-commit-msg-hook.sh            |   17 ++-\n t/t9100-git-svn-basic.sh                      |  120 +++++++++---------\n t/t9101-git-svn-props.sh                      |    8 +-\n t/t9102-git-svn-deep-rmdir.sh                 |   20 ++--\n t/t9103-git-svn-tracked-directory-removed.sh  |   20 ++--\n t/t9104-git-svn-follow-parent.sh              |  172 ++++++++++++------------\n t/t9105-git-svn-commit-diff.sh                |   32 +++---\n t/t9106-git-svn-commit-diff-clobber.sh        |   56 ++++----\n t/t9106-git-svn-dcommit-clobber-series.sh     |   30 ++--\n t/t9107-git-svn-migrate.sh                    |  124 +++++++++---------\n t/t9108-git-svn-glob.sh                       |   76 ++++++------\n t/t9110-git-svn-use-svm-props.sh              |   12 +-\n t/t9111-git-svn-use-svnsync-props.sh          |   12 +-\n t/t9112-git-svn-md5less-file.sh               |    4 +-\n t/t9113-git-svn-dcommit-new-file.sh           |   10 +-\n t/t9114-git-svn-dcommit-merge.sh              |   22 ++--\n t/t9115-git-svn-dcommit-funky-renames.sh      |   12 +-\n t/t9116-git-svn-log.sh                        |   12 +-\n t/t9117-git-svn-init-clone.sh                 |   30 ++--\n t/t9118-git-svn-funky-branch-names.sh         |   24 ++--\n t/t9120-git-svn-clone-with-percent-escapes.sh |    6 +-\n t/t9500-gitweb-standalone-no-errors.sh        |   11 +-\n 36 files changed, 460 insertions(+), 454 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex 27b54cb..690f80a 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -305,10 +305,10 @@ test_expect_success 'absolute path works as expected' '\n \tfile=\"$dir\"/index &&\n \ttest \"$file\" = \"$(test-absolute-path $dir2/index)\" &&\n \tbasename=blub &&\n-\ttest \"$dir/$basename\" = $(cd .git && test-absolute-path $basename) &&\n+\ttest \"$dir/$basename\" = \"$(cd .git && test-absolute-path \"$basename\")\" &&\n \tln -s ../first/file .git/syml &&\n \tsym=\"$(cd first; pwd -P)\"/file &&\n-\ttest \"$sym\" = \"$(test-absolute-path $dir2/syml)\"\n+\ttest \"$sym\" = \"$(test-absolute-path \"$dir2/syml\")\"\n '\n \n test_expect_success 'very long name in the index handled sanely' '\ndiff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh\nindex b9cef34..fc386ba 100755\n--- a/t/t1020-subdirectory.sh\n+++ b/t/t1020-subdirectory.sh\n@@ -21,7 +21,7 @@ LF='\n '\n \n test_expect_success 'update-index and ls-files' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit update-index --add one &&\n \tcase \"`git ls-files`\" in\n \tone) echo ok one ;;\n@@ -41,7 +41,7 @@ test_expect_success 'update-index and ls-files' '\n '\n \n test_expect_success 'cat-file' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \ttwo=`git ls-files -s dir/two` &&\n \ttwo=`expr \"$two\" : \"[0-7]* \\\\([0-9a-f]*\\\\)\"` &&\n \techo \"$two\" &&\n@@ -54,7 +54,7 @@ test_expect_success 'cat-file' '\n rm -f actual dir/actual\n \n test_expect_success 'diff-files' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \techo a >>one &&\n \techo d >>dir/two &&\n \tcase \"`git diff-files --name-only`\" in\n@@ -74,7 +74,7 @@ test_expect_success 'diff-files' '\n '\n \n test_expect_success 'write-tree' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \ttop=`git write-tree` &&\n \techo $top &&\n \tcd dir &&\n@@ -84,7 +84,7 @@ test_expect_success 'write-tree' '\n '\n \n test_expect_success 'checkout-index' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit checkout-index -f -u one &&\n \tcmp one original.one &&\n \tcd dir &&\n@@ -93,7 +93,7 @@ test_expect_success 'checkout-index' '\n '\n \n test_expect_success 'read-tree' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \trm -f one dir/two &&\n \ttree=`git write-tree` &&\n \tgit read-tree --reset -u \"$tree\" &&\n@@ -107,27 +107,27 @@ test_expect_success 'read-tree' '\n '\n \n test_expect_success 'no file/rev ambiguity check inside .git' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit commit -a -m 1 &&\n-\tcd $HERE/.git &&\n+\tcd \"$HERE\"/.git &&\n \tgit show -s HEAD\n '\n \n test_expect_success 'no file/rev ambiguity check inside a bare repo' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit clone -s --bare .git foo.git &&\n \tcd foo.git && GIT_DIR=. git show -s HEAD\n '\n \n # This still does not work as it should...\n : test_expect_success 'no file/rev ambiguity check inside a bare repo' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \tgit clone -s --bare .git foo.git &&\n \tcd foo.git && git show -s HEAD\n '\n \n test_expect_success 'detection should not be fooled by a symlink' '\n-\tcd $HERE &&\n+\tcd \"$HERE\" &&\n \trm -fr foo.git &&\n \tgit clone -s .git another &&\n \tln -s another yetanother &&\ndiff --git a/t/t3050-subprojects-fetch.sh b/t/t3050-subprojects-fetch.sh\nindex 2b21b10..4261e96 100755\n--- a/t/t3050-subprojects-fetch.sh\n+++ b/t/t3050-subprojects-fetch.sh\n@@ -20,7 +20,7 @@ test_expect_success setup '\n '\n \n test_expect_success clone '\n-\tgit clone file://`pwd`/.git cloned &&\n+\tgit clone \"file://$(pwd)/.git\" cloned &&\n \t(git rev-parse HEAD; git ls-files -s) >expected &&\n \t(\n \t\tcd cloned &&\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 9cf873f..b9e3dbd 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -91,9 +91,8 @@ for line in $FAKE_LINES; do\n done\n EOF\n \n+test_set_editor \"$(pwd)/fake-editor.sh\"\n chmod a+x fake-editor.sh\n-VISUAL=\"$(pwd)/fake-editor.sh\"\n-export VISUAL\n \n test_expect_success 'no changes are a nop' '\n \tgit rebase -i F &&\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 1700d07..140e874 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -129,7 +129,7 @@ pull_to_client 2nd \"B\" $((64*3))\n \n pull_to_client 3rd \"A\" $((1*3)) # old fails\n \n-test_expect_success \"clone shallow\" \"git-clone --depth 2 file://`pwd`/. shallow\"\n+test_expect_success \"clone shallow\" 'git-clone --depth 2 \"file://$(pwd)/.\" shallow'\n \n (cd shallow; git count-objects -v) > count.shallow\n \ndiff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh\nindex c0dc949..1dd8eed 100755\n--- a/t/t5512-ls-remote.sh\n+++ b/t/t5512-ls-remote.sh\n@@ -17,7 +17,7 @@ test_expect_success setup '\n \t\tgit show-ref -d\t| sed -e \"s/ /\t/\"\n \t) >expected.all &&\n \n-\tgit remote add self $(pwd)/.git\n+\tgit remote add self \"$(pwd)/.git\"\n \n '\n \ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex 0a757d5..3af03d4 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -105,7 +105,7 @@ test_expect_success 'fetch with insteadOf' '\n \t(\n \t\tTRASH=$(pwd)/ &&\n \t\tcd testrepo &&\n-\t\tgit config url.$TRASH.insteadOf trash/\n+\t\tgit config \"url.$TRASH.insteadOf\" trash/ &&\n \t\tgit config remote.up.url trash/. &&\n \t\tgit config remote.up.fetch \"refs/heads/*:refs/remotes/origin/*\" &&\n \t\tgit fetch up &&\n@@ -145,8 +145,8 @@ test_expect_success 'push with wildcard' '\n \n test_expect_success 'push with insteadOf' '\n \tmk_empty &&\n-\tTRASH=$(pwd)/ &&\n-\tgit config url.$TRASH.insteadOf trash/ &&\n+\tTRASH=\"$(pwd)/\" &&\n+\tgit config \"url./$TRASH/.insteadOf\" trash/ &&\n \tgit push trash/testrepo refs/heads/master:refs/remotes/origin/master &&\n \t(\n \t\tcd testrepo &&\ndiff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh\nindex b6a5486..e5619a9 100755\n--- a/t/t5700-clone-reference.sh\n+++ b/t/t5700-clone-reference.sh\n@@ -51,7 +51,7 @@ diff expected current'\n cd \"$base_dir\"\n \n test_expect_success 'cloning with reference (no -l -s)' \\\n-'git clone --reference B file://`pwd`/A D'\n+'git clone --reference B \"file://$(pwd)/A\" D'\n \n cd \"$base_dir\"\n \ndiff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh\nindex 910ccb4..ef7127c 100755\n--- a/t/t5710-info-alternate.sh\n+++ b/t/t5710-info-alternate.sh\n@@ -81,9 +81,9 @@ test_valid_repo'\n cd \"$base_dir\"\n \n test_expect_success 'breaking of loops' \\\n-\"echo '$base_dir/B/.git/objects' >> '$base_dir'/A/.git/objects/info/alternates&&\n+'echo \"$base_dir\"/B/.git/objects >> \"$base_dir\"/A/.git/objects/info/alternates&&\n cd C &&\n-test_valid_repo\"\n+test_valid_repo'\n \n cd \"$base_dir\"\n \ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex efd658a..fd09030 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -125,7 +125,7 @@ test_expect_success 'use index-filter to move into a subdirectory' '\n \t\t \"git ls-files -s | sed \\\"s-\\\\t-&newsubdir/-\\\" |\n \t          GIT_INDEX_FILE=\\$GIT_INDEX_FILE.new \\\n \t\t\tgit update-index --index-info &&\n-\t\t  mv \\$GIT_INDEX_FILE.new \\$GIT_INDEX_FILE\" directorymoved &&\n+\t\t  mv \\\"\\$GIT_INDEX_FILE.new\\\" \\\"\\$GIT_INDEX_FILE\\\"\" directorymoved &&\n \ttest -z \"$(git diff HEAD directorymoved:newsubdir)\"'\n \n test_expect_success 'stops when msg filter fails' '\ndiff --git a/t/t7010-setup.sh b/t/t7010-setup.sh\nindex 02cf7c5..d8a7c79 100755\n--- a/t/t7010-setup.sh\n+++ b/t/t7010-setup.sh\n@@ -122,7 +122,7 @@ test_expect_success 'commit using absolute path names' '\n \n test_expect_success 'log using absolute path names' '\n \techo bb >>a/b/c/d &&\n-\tgit commit -m \"bb\" $(pwd)/a/b/c/d &&\n+\tgit commit -m \"bb\" \"$(pwd)/a/b/c/d\" &&\n \n \tgit log a/b/c/d >f1.txt &&\n \tgit log \"$(pwd)/a/b/c/d\" >f2.txt &&\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nindex a50492f..bd77239 100755\n--- a/t/t7300-clean.sh\n+++ b/t/t7300-clean.sh\n@@ -112,7 +112,7 @@ test_expect_success 'git-clean with absolute path' '\n \ttouch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&\n \twould_clean=$(\n \t\tcd docs &&\n-\t\tgit clean -n $(pwd)/../src |\n+\t\tgit clean -n \"$(pwd)/../src\" |\n \t\tsed -n -e \"s|^Would remove ||p\"\n \t) &&\n \ttest \"$would_clean\" = ../src/part3.c || {\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex c0288f3..e5fdb63 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -79,8 +79,8 @@ test_expect_success \\\n \n cat >editor <<\\EOF\n #!/bin/sh\n-sed -e \"s/a file/an amend commit/g\" < $1 > $1-\n-mv $1- $1\n+sed -e \"s/a file/an amend commit/g\" < \"$1\" > \"$1-\"\n+mv \"$1-\" \"$1\"\n EOF\n chmod 755 editor\n \n@@ -99,8 +99,8 @@ test_expect_success \\\n \n cat >editor <<\\EOF\n #!/bin/sh\n-sed -e \"s/amend/older/g\"  < $1 > $1-\n-mv $1- $1\n+sed -e \"s/amend/older/g\"  < \"$1\" > \"$1-\"\n+mv \"$1-\" \"$1\"\n EOF\n chmod 755 editor\n \ndiff --git a/t/t7504-commit-msg-hook.sh b/t/t7504-commit-msg-hook.sh\nindex eff36aa..88577af 100755\n--- a/t/t7504-commit-msg-hook.sh\n+++ b/t/t7504-commit-msg-hook.sh\n@@ -19,6 +19,9 @@ cp FAKE_MSG \"$1\"\n exit 0\n EOF\n chmod +x fake-editor\n+\n+## Not using test_set_editor here so we can easily ensure the editor variable\n+## is only set for the editor tests\n FAKE_EDITOR=\"$(pwd)/fake-editor\"\n export FAKE_EDITOR\n \n@@ -27,7 +30,7 @@ test_expect_success 'with no hook (editor)' '\n \techo \"more foo\" >> file &&\n \tgit add file &&\n \techo \"more foo\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit\n \n '\n \n@@ -44,7 +47,7 @@ test_expect_success '--no-verify with no hook (editor)' '\n \techo \"more bar\" > file &&\n \tgit add file &&\n \techo \"more bar\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify\n \n '\n \n@@ -71,7 +74,7 @@ test_expect_success 'with succeeding hook (editor)' '\n \techo \"more more\" >> file &&\n \tgit add file &&\n \techo \"more more\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit\n \n '\n \n@@ -88,7 +91,7 @@ test_expect_success '--no-verify with succeeding hook (editor)' '\n \techo \"even more more\" >> file &&\n \tgit add file &&\n \techo \"even more more\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify\n \n '\n \n@@ -111,7 +114,7 @@ test_expect_success 'with failing hook (editor)' '\n \techo \"more another\" >> file &&\n \tgit add file &&\n \techo \"more another\" > FAKE_MSG &&\n-\t! (GIT_EDITOR=\"$FAKE_EDITOR\" git commit)\n+\t! (GIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit)\n \n '\n \n@@ -128,7 +131,7 @@ test_expect_success '--no-verify with failing hook (editor)' '\n \techo \"more stuff\" >> file &&\n \tgit add file &&\n \techo \"more stuff\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify\n \n '\n \n@@ -146,7 +149,7 @@ test_expect_success 'with non-executable hook (editor)' '\n \techo \"content again\" >> file &&\n \tgit add file &&\n \techo \"content again\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit -m \"content again\"\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -m \"content again\"\n \n '\n \n@@ -163,7 +166,7 @@ test_expect_success '--no-verify with non-executable hook (editor)' '\n \techo \"even more content\" >> file &&\n \tgit add file &&\n \techo \"even more content\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify\n \n '\n \n@@ -193,7 +196,7 @@ test_expect_success 'hook edits commit message (editor)' '\n \techo \"additional content\" >> file &&\n \tgit add file &&\n \techo \"additional content\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit &&\n \tcommit_msg_is \"new message\"\n \n '\n@@ -212,7 +215,7 @@ test_expect_success \"hook doesn't edit commit message (editor)\" '\n \techo \"more plus\" >> file &&\n \tgit add file &&\n \techo \"more plus\" > FAKE_MSG &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify &&\n \tcommit_msg_is \"more plus\"\n \n '\ndiff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh\nindex 802aa62..cd6c7c8 100755\n--- a/t/t7505-prepare-commit-msg-hook.sh\n+++ b/t/t7505-prepare-commit-msg-hook.sh\n@@ -18,6 +18,9 @@ cat > fake-editor <<'EOF'\n exit 0\n EOF\n chmod +x fake-editor\n+\n+## Not using test_set_editor here so we can easily ensure the editor variable\n+## is only set for the editor tests\n FAKE_EDITOR=\"$(pwd)/fake-editor\"\n export FAKE_EDITOR\n \n@@ -58,7 +61,7 @@ test_expect_success 'with hook (-m editor)' '\n \n \techo \"more\" >> file &&\n \tgit add file &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit -e -m \"more more\" &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -e -m \"more more\" &&\n \ttest \"`git log -1 --pretty=format:%s`\" = message\n \n '\n@@ -85,7 +88,7 @@ test_expect_success 'with hook (-F editor)' '\n \n \techo \"more\" >> file &&\n \tgit add file &&\n-\t(echo more more | GIT_EDITOR=\"$FAKE_EDITOR\" git commit -e -F -) &&\n+\t(echo more more | GIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -e -F -) &&\n \ttest \"`git log -1 --pretty=format:%s`\" = message\n \n '\n@@ -104,7 +107,7 @@ test_expect_success 'with hook (editor)' '\n \n \techo \"more more\" >> file &&\n \tgit add file &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit &&\n \ttest \"`git log -1 --pretty=format:%s`\" = default\n \n '\n@@ -114,7 +117,7 @@ test_expect_success 'with hook (--amend)' '\n \thead=`git rev-parse HEAD` &&\n \techo \"more\" >> file &&\n \tgit add file &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit --amend &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --amend &&\n \ttest \"`git log -1 --pretty=format:%s`\" = \"$head\"\n \n '\n@@ -124,7 +127,7 @@ test_expect_success 'with hook (-c)' '\n \thead=`git rev-parse HEAD` &&\n \techo \"more\" >> file &&\n \tgit add file &&\n-\tGIT_EDITOR=\"$FAKE_EDITOR\" git commit -c $head &&\n+\tGIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -c $head &&\n \ttest \"`git log -1 --pretty=format:%s`\" = \"$head\"\n \n '\n@@ -139,7 +142,7 @@ test_expect_success 'with failing hook' '\n \thead=`git rev-parse HEAD` &&\n \techo \"more\" >> file &&\n \tgit add file &&\n-\t! GIT_EDITOR=\"$FAKE_EDITOR\" git commit -c $head\n+\t! GIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit -c $head\n \n '\n \n@@ -148,7 +151,7 @@ test_expect_success 'with failing hook (--no-verify)' '\n \thead=`git rev-parse HEAD` &&\n \techo \"more\" >> file &&\n \tgit add file &&\n-\t! GIT_EDITOR=\"$FAKE_EDITOR\" git commit --no-verify -c $head\n+\t! GIT_EDITOR=\"\\\"\\$FAKE_EDITOR\\\"\" git commit --no-verify -c $head\n \n '\n \ndiff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh\nindex 4e24ab3..bdf29c1 100755\n--- a/t/t9100-git-svn-basic.sh\n+++ b/t/t9100-git-svn-basic.sh\n@@ -20,39 +20,39 @@ esac\n echo 'define NO_SVN_TESTS to skip git-svn tests'\n \n test_expect_success \\\n-    'initialize git-svn' \"\n+    'initialize git-svn' '\n \tmkdir import &&\n \tcd import &&\n \techo foo > foo &&\n \tln -s foo foo.link\n \tmkdir -p dir/a/b/c/d/e &&\n-\techo 'deep dir' > dir/a/b/c/d/e/file &&\n+\techo \"deep dir\" > dir/a/b/c/d/e/file &&\n \tmkdir bar &&\n-\techo 'zzz' > bar/zzz &&\n-\techo '#!/bin/sh' > exec.sh &&\n+\techo \"zzz\" > bar/zzz &&\n+\techo \"#!/bin/sh\" > exec.sh &&\n \tchmod +x exec.sh &&\n-\tsvn import -m 'import for git-svn' . $svnrepo >/dev/null &&\n+\tsvn import -m \"import for git-svn\" . \"$svnrepo\" >/dev/null &&\n \tcd .. &&\n \trm -rf import &&\n-\tgit-svn init $svnrepo\"\n+\tgit-svn init \"$svnrepo\"'\n \n test_expect_success \\\n     'import an SVN revision into git' \\\n     'git-svn fetch'\n \n-test_expect_success \"checkout from svn\" \"svn co $svnrepo '$SVN_TREE'\"\n+test_expect_success \"checkout from svn\" 'svn co \"$svnrepo\" \"$SVN_TREE\"'\n \n name='try a deep --rmdir with a commit'\n-test_expect_success \"$name\" \"\n+test_expect_success \"$name\" '\n \tgit checkout -f -b mybranch remotes/git-svn &&\n \tmv dir/a/b/c/d/e/file dir/file &&\n \tcp dir/file file &&\n \tgit update-index --add --remove dir/a/b/c/d/e/file dir/file file &&\n-\tgit commit -m '$name' &&\n+\tgit commit -m \"$name\" &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -d '$SVN_TREE'/dir && test ! -d '$SVN_TREE'/dir/a\"\n+\tsvn up \"$SVN_TREE\" &&\n+\ttest -d \"$SVN_TREE\"/dir && test ! -d \"$SVN_TREE\"/dir/a'\n \n \n name='detect node change from file to directory #1'\n@@ -68,108 +68,108 @@ test_expect_success \"$name\" \"\n \n \n name='detect node change from directory to file #1'\n-test_expect_success \"$name\" \"\n-\trm -rf dir '$GIT_DIR'/index &&\n+test_expect_success \"$name\" '\n+\trm -rf dir \"$GIT_DIR\"/index &&\n \tgit checkout -f -b mybranch2 remotes/git-svn &&\n \tmv bar/zzz zzz &&\n \trm -rf bar &&\n \tmv zzz bar &&\n \tgit update-index --remove -- bar/zzz &&\n \tgit update-index --add -- bar &&\n-\tgit commit -m '$name' &&\n+\tgit commit -m \"$name\" &&\n \t! git-svn set-tree --find-copies-harder --rmdir \\\n-\t\tremotes/git-svn..mybranch2\" || true\n+\t\tremotes/git-svn..mybranch2' || true\n \n \n name='detect node change from file to directory #2'\n-test_expect_success \"$name\" \"\n-\trm -f '$GIT_DIR'/index &&\n+test_expect_success \"$name\" '\n+\trm -f \"$GIT_DIR\"/index &&\n \tgit checkout -f -b mybranch3 remotes/git-svn &&\n \trm bar/zzz &&\n \tgit update-index --remove bar/zzz &&\n \tmkdir bar/zzz &&\n \techo yyy > bar/zzz/yyy &&\n \tgit update-index --add bar/zzz/yyy &&\n-\tgit commit -m '$name' &&\n+\tgit commit -m \"$name\" &&\n \t! git-svn set-tree --find-copies-harder --rmdir \\\n-\t\tremotes/git-svn..mybranch3\" || true\n+\t\tremotes/git-svn..mybranch3' || true\n \n \n name='detect node change from directory to file #2'\n-test_expect_success \"$name\" \"\n-\trm -f '$GIT_DIR'/index &&\n+test_expect_success \"$name\" '\n+\trm -f \"$GIT_DIR\"/index &&\n \tgit checkout -f -b mybranch4 remotes/git-svn &&\n \trm -rf dir &&\n \tgit update-index --remove -- dir/file &&\n \ttouch dir &&\n \techo asdf > dir &&\n \tgit update-index --add -- dir &&\n-\tgit commit -m '$name' &&\n+\tgit commit -m \"$name\" &&\n \t! git-svn set-tree --find-copies-harder --rmdir \\\n-\t\tremotes/git-svn..mybranch4\" || true\n+\t\tremotes/git-svn..mybranch4' || true\n \n \n name='remove executable bit from a file'\n-test_expect_success \"$name\" \"\n-\trm -f '$GIT_DIR'/index &&\n+test_expect_success \"$name\" '\n+\trm -f \"$GIT_DIR\"/index &&\n \tgit checkout -f -b mybranch5 remotes/git-svn &&\n \tchmod -x exec.sh &&\n \tgit update-index exec.sh &&\n-\tgit commit -m '$name' &&\n+\tgit commit -m \"$name\" &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest ! -x '$SVN_TREE'/exec.sh\"\n+\tsvn up \"$SVN_TREE\" &&\n+\ttest ! -x \"$SVN_TREE\"/exec.sh'\n \n \n name='add executable bit back file'\n-test_expect_success \"$name\" \"\n+test_expect_success \"$name\" '\n \tchmod +x exec.sh &&\n \tgit update-index exec.sh &&\n-\tgit commit -m '$name' &&\n+\tgit commit -m \"$name\" &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -x '$SVN_TREE'/exec.sh\"\n+\tsvn up \"$SVN_TREE\" &&\n+\ttest -x \"$SVN_TREE\"/exec.sh'\n \n \n name='executable file becomes a symlink to bar/zzz (file)'\n-test_expect_success \"$name\" \"\n+test_expect_success \"$name\" '\n \trm exec.sh &&\n \tln -s bar/zzz exec.sh &&\n \tgit update-index exec.sh &&\n-\tgit commit -m '$name' &&\n+\tgit commit -m \"$name\" &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -L '$SVN_TREE'/exec.sh\"\n+\tsvn up \"$SVN_TREE\" &&\n+\ttest -L \"$SVN_TREE\"/exec.sh'\n \n name='new symlink is added to a file that was also just made executable'\n \n-test_expect_success \"$name\" \"\n+test_expect_success \"$name\" '\n \tchmod +x bar/zzz &&\n \tln -s bar/zzz exec-2.sh &&\n \tgit update-index --add bar/zzz exec-2.sh &&\n-\tgit commit -m '$name' &&\n+\tgit commit -m \"$name\" &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -x '$SVN_TREE'/bar/zzz &&\n-\ttest -L '$SVN_TREE'/exec-2.sh\"\n+\tsvn up \"$SVN_TREE\" &&\n+\ttest -x \"$SVN_TREE\"/bar/zzz &&\n+\ttest -L \"$SVN_TREE\"/exec-2.sh'\n \n name='modify a symlink to become a file'\n-test_expect_success \"$name\" \"\n+test_expect_success \"$name\" '\n \techo git help > help || true &&\n \trm exec-2.sh &&\n \tcp help exec-2.sh &&\n \tgit update-index exec-2.sh &&\n-\tgit commit -m '$name' &&\n+\tgit commit -m \"$name\" &&\n \tgit-svn set-tree --find-copies-harder --rmdir \\\n \t\tremotes/git-svn..mybranch5 &&\n-\tsvn up '$SVN_TREE' &&\n-\ttest -f '$SVN_TREE'/exec-2.sh &&\n-\ttest ! -L '$SVN_TREE'/exec-2.sh &&\n-\tgit diff help $SVN_TREE/exec-2.sh\"\n+\tsvn up \"$SVN_TREE\" &&\n+\ttest -f \"$SVN_TREE\"/exec-2.sh &&\n+\ttest ! -L \"$SVN_TREE\"/exec-2.sh &&\n+\tgit diff help \"$SVN_TREE\"/exec-2.sh'\n \n if test \"$have_utf8\" = t\n then\n@@ -190,10 +190,10 @@ name='test fetch functionality (svn => git) with alternate GIT_SVN_ID'\n GIT_SVN_ID=alt\n export GIT_SVN_ID\n test_expect_success \"$name\" \\\n-    \"git-svn init $svnrepo && git-svn fetch &&\n+    'git-svn init \"$svnrepo\" && git-svn fetch &&\n      git rev-list --pretty=raw remotes/git-svn | grep ^tree | uniq > a &&\n      git rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&\n-     git diff a b\"\n+     git diff a b'\n \n name='check imported tree checksums expected tree checksums'\n rm -f expected\n@@ -219,22 +219,22 @@ test_expect_success 'exit if remote refs are ambigious' \"\n \t! git-svn migrate\n \"\n \n-test_expect_success 'exit if init-ing a would clobber a URL' \"\n-        svnadmin create ${PWD}/svnrepo2 &&\n-        svn mkdir -m 'mkdir bar' ${svnrepo}2/bar &&\n+test_expect_success 'exit if init-ing a would clobber a URL' '\n+        svnadmin create \"${PWD}/svnrepo2\" &&\n+        svn mkdir -m \"mkdir bar\" \"${svnrepo}2/bar\" &&\n         git config --unset svn-remote.svn.fetch \\\n-                                '^bar:refs/remotes/git-svn$' &&\n-\t! git-svn init ${svnrepo}2/bar\n-        \"\n+                                \"^bar:refs/remotes/git-svn$\" &&\n+\t! git-svn init \"${svnrepo}2/bar\"\n+        '\n \n test_expect_success \\\n-  'init allows us to connect to another directory in the same repo' \"\n-        git-svn init --minimize-url -i bar $svnrepo/bar &&\n+  'init allows us to connect to another directory in the same repo' '\n+        git-svn init --minimize-url -i bar \"$svnrepo/bar\" &&\n         git config --get svn-remote.svn.fetch \\\n-                              '^bar:refs/remotes/bar$' &&\n+                              \"^bar:refs/remotes/bar$\" &&\n         git config --get svn-remote.svn.fetch \\\n-                              '^:refs/remotes/git-svn$'\n-        \"\n+                              \"^:refs/remotes/git-svn$\"\n+        '\n \n test_expect_success 'able to dcommit to a subdirectory' \"\n \tgit-svn fetch -i bar &&\ndiff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\nindex d7a7047..f420796 100755\n--- a/t/t9101-git-svn-props.sh\n+++ b/t/t9101-git-svn-props.sh\n@@ -52,7 +52,7 @@ EOF\n cd ..\n \n rm -rf import\n-test_expect_success 'checkout working copy from svn' \"svn co $svnrepo test_wc\"\n+test_expect_success 'checkout working copy from svn' 'svn co \"$svnrepo\" test_wc'\n test_expect_success 'setup some commits to svn' \\\n \t'cd test_wc &&\n \t\techo Greetings >> kw.c &&\n@@ -66,7 +66,7 @@ test_expect_success 'setup some commits to svn' \\\n \t\tsvn commit -m \"Propset Id\" &&\n \tcd ..'\n \n-test_expect_success 'initialize git-svn' \"git-svn init $svnrepo\"\n+test_expect_success 'initialize git-svn' 'git-svn init \"$svnrepo\"'\n test_expect_success 'fetch revisions from svn' 'git-svn fetch'\n \n name='test svn:keywords ignoring'\n@@ -90,9 +90,9 @@ test_expect_success \"propset CR on crlf files\" \\\n \t cd ..'\n \n test_expect_success 'fetch and pull latest from svn and checkout a new wc' \\\n-\t\"git-svn fetch &&\n+\t'git-svn fetch &&\n \t git pull . remotes/git-svn &&\n-\t svn co $svnrepo new_wc\"\n+\t svn co \"$svnrepo\" new_wc'\n \n for i in crlf ne_crlf lf ne_lf cr ne_cr empty_cr empty_lf empty empty_crlf\n do\ndiff --git a/t/t9102-git-svn-deep-rmdir.sh b/t/t9102-git-svn-deep-rmdir.sh\nindex 4e08083..0e7ce34 100755\n--- a/t/t9102-git-svn-deep-rmdir.sh\n+++ b/t/t9102-git-svn-deep-rmdir.sh\n@@ -2,29 +2,29 @@\n test_description='git-svn rmdir'\n . ./lib-git-svn.sh\n \n-test_expect_success 'initialize repo' \"\n+test_expect_success 'initialize repo' '\n \tmkdir import &&\n \tcd import &&\n \tmkdir -p deeply/nested/directory/number/1 &&\n \tmkdir -p deeply/nested/directory/number/2 &&\n \techo foo > deeply/nested/directory/number/1/file &&\n \techo foo > deeply/nested/directory/number/2/another &&\n-\tsvn import -m 'import for git-svn' . $svnrepo &&\n+\tsvn import -m \"import for git-svn\" . \"$svnrepo\" &&\n \tcd ..\n-\t\"\n+\t'\n \n-test_expect_success 'mirror via git-svn' \"\n-\tgit-svn init $svnrepo &&\n+test_expect_success 'mirror via git-svn' '\n+\tgit-svn init \"$svnrepo\" &&\n \tgit-svn fetch &&\n \tgit checkout -f -b test-rmdir remotes/git-svn\n-\t\"\n+\t'\n \n-test_expect_success 'Try a commit on rmdir' \"\n+test_expect_success 'Try a commit on rmdir' '\n \tgit rm -f deeply/nested/directory/number/2/another &&\n-\tgit commit -a -m 'remove another' &&\n+\tgit commit -a -m \"remove another\" &&\n \tgit-svn set-tree --rmdir HEAD &&\n-\tsvn ls -R $svnrepo | grep ^deeply/nested/directory/number/1\n-\t\"\n+\tsvn ls -R \"$svnrepo\" | grep ^deeply/nested/directory/number/1\n+\t'\n \n \n test_done\ndiff --git a/t/t9103-git-svn-tracked-directory-removed.sh b/t/t9103-git-svn-tracked-directory-removed.sh\nindex 0f0b0fd..9ffd845 100755\n--- a/t/t9103-git-svn-tracked-directory-removed.sh\n+++ b/t/t9103-git-svn-tracked-directory-removed.sh\n@@ -10,30 +10,30 @@ test_expect_success 'make history for tracking' '\n \tmkdir import &&\n \tmkdir import/trunk &&\n \techo hello >> import/trunk/README &&\n-\tsvn import -m initial import $svnrepo &&\n+\tsvn import -m initial import \"$svnrepo\" &&\n \trm -rf import &&\n-\tsvn co $svnrepo/trunk trunk &&\n+\tsvn co \"$svnrepo\"/trunk trunk &&\n \techo bye bye >> trunk/README &&\n-\tsvn rm -m \"gone\" $svnrepo/trunk &&\n+\tsvn rm -m \"gone\" \"$svnrepo\"/trunk &&\n \trm -rf trunk &&\n \tmkdir trunk &&\n \techo \"new\" > trunk/FOLLOWME &&\n-\tsvn import -m \"new trunk\" trunk $svnrepo/trunk\n+\tsvn import -m \"new trunk\" trunk \"$svnrepo\"/trunk\n '\n \n test_expect_success 'clone repo with git' '\n-\tgit svn clone -s $svnrepo x &&\n+\tgit svn clone -s \"$svnrepo\" x &&\n \ttest -f x/FOLLOWME &&\n \ttest ! -f x/README\n '\n \n-test_expect_success 'make sure r2 still has old file' '\n+test_expect_success 'make sure r2 still has old file' \"\n \tcd x &&\n-\t\ttest -n \"$(git svn find-rev r1)\" &&\n-\t\tgit reset --hard $(git svn find-rev r1) &&\n+\t\ttest -n \\\"\\$(git svn find-rev r1)\\\" &&\n+\t\tgit reset --hard \\$(git svn find-rev r1) &&\n \t\ttest -f README &&\n \t\ttest ! -f FOLLOWME &&\n-\t\ttest x$(git svn find-rev r2) = x\n-'\n+\t\ttest x\\$(git svn find-rev r2) = x\n+\"\n \n test_done\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex 7ba7630..4d964e2 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -6,165 +6,165 @@\n test_description='git-svn fetching'\n . ./lib-git-svn.sh\n \n-test_expect_success 'initialize repo' \"\n+test_expect_success 'initialize repo' '\n \tmkdir import &&\n \tcd import &&\n \tmkdir -p trunk &&\n \techo hello > trunk/readme &&\n-\tsvn import -m 'initial' . $svnrepo &&\n+\tsvn import -m \"initial\" . \"$svnrepo\" &&\n \tcd .. &&\n-\tsvn co $svnrepo wc &&\n+\tsvn co \"$svnrepo\" wc &&\n \tcd wc &&\n \techo world >> trunk/readme &&\n \tpoke trunk/readme &&\n-\tsvn commit -m 'another commit' &&\n+\tsvn commit -m \"another commit\" &&\n \tsvn up &&\n \tsvn mv trunk thunk &&\n \techo goodbye >> thunk/readme &&\n \tpoke thunk/readme &&\n-\tsvn commit -m 'bye now' &&\n+\tsvn commit -m \"bye now\" &&\n \tcd ..\n-\t\"\n+\t'\n \n-test_expect_success 'init and fetch a moved directory' \"\n-\tgit-svn init --minimize-url -i thunk $svnrepo/thunk &&\n+test_expect_success 'init and fetch a moved directory' '\n+\tgit-svn init --minimize-url -i thunk \"$svnrepo\"/thunk &&\n \tgit-svn fetch -i thunk &&\n-\ttest \\\"\\`git rev-parse --verify refs/remotes/thunk@2\\`\\\" \\\n-           = \\\"\\`git rev-parse --verify refs/remotes/thunk~1\\`\\\" &&\n-        test \\\"\\`git cat-file blob refs/remotes/thunk:readme |\\\n-                 sed -n -e '3p'\\`\\\" = goodbye &&\n-\ttest -z \\\"\\`git config --get svn-remote.svn.fetch \\\n-\t         '^trunk:refs/remotes/thunk@2$'\\`\\\"\n-\t\"\n+\ttest \"`git rev-parse --verify refs/remotes/thunk@2`\" \\\n+           = \"`git rev-parse --verify refs/remotes/thunk~1`\" &&\n+        test \"`git cat-file blob refs/remotes/thunk:readme |\\\n+                 sed -n -e \"3p\"`\" = goodbye &&\n+\ttest -z \"`git config --get svn-remote.svn.fetch \\\n+\t         \"^trunk:refs/remotes/thunk@2$\"`\"\n+\t'\n \n-test_expect_success 'init and fetch from one svn-remote' \"\n-        git config svn-remote.svn.url $svnrepo &&\n+test_expect_success 'init and fetch from one svn-remote' '\n+        git config svn-remote.svn.url \"$svnrepo\" &&\n         git config --add svn-remote.svn.fetch \\\n           trunk:refs/remotes/svn/trunk &&\n         git config --add svn-remote.svn.fetch \\\n           thunk:refs/remotes/svn/thunk &&\n         git-svn fetch -i svn/thunk &&\n-\ttest \\\"\\`git rev-parse --verify refs/remotes/svn/trunk\\`\\\" \\\n-           = \\\"\\`git rev-parse --verify refs/remotes/svn/thunk~1\\`\\\" &&\n-        test \\\"\\`git cat-file blob refs/remotes/svn/thunk:readme |\\\n-                 sed -n -e '3p'\\`\\\" = goodbye\n-        \"\n+\ttest \"`git rev-parse --verify refs/remotes/svn/trunk`\" \\\n+           = \"`git rev-parse --verify refs/remotes/svn/thunk~1`\" &&\n+        test \"`git cat-file blob refs/remotes/svn/thunk:readme |\\\n+                 sed -n -e \"3p\"`\" = goodbye\n+        '\n \n-test_expect_success 'follow deleted parent' \"\n-        (svn cp -m 'resurrecting trunk as junk' \\\n-               $svnrepo/trunk@2 $svnrepo/junk ||\n-         svn cp -m 'resurrecting trunk as junk' \\\n-               -r2 $svnrepo/trunk $svnrepo/junk) &&\n+test_expect_success 'follow deleted parent' '\n+        (svn cp -m \"resurrecting trunk as junk\" \\\n+               \"$svnrepo\"/trunk@2 \"$svnrepo\"/junk ||\n+         svn cp -m \"resurrecting trunk as junk\" \\\n+               -r2 \"$svnrepo\"/trunk \"$svnrepo\"/junk) &&\n         git config --add svn-remote.svn.fetch \\\n           junk:refs/remotes/svn/junk &&\n         git-svn fetch -i svn/thunk &&\n         git-svn fetch -i svn/junk &&\n-        test -z \\\"\\`git diff svn/junk svn/trunk\\`\\\" &&\n-        test \\\"\\`git merge-base svn/junk svn/trunk\\`\\\" \\\n-           = \\\"\\`git rev-parse svn/trunk\\`\\\"\n-        \"\n+        test -z \"`git diff svn/junk svn/trunk`\" &&\n+        test \"`git merge-base svn/junk svn/trunk`\" \\\n+           = \"`git rev-parse svn/trunk`\"\n+        '\n \n-test_expect_success 'follow larger parent' \"\n+test_expect_success 'follow larger parent' '\n         mkdir -p import/trunk/thunk/bump/thud &&\n         echo hi > import/trunk/thunk/bump/thud/file &&\n-        svn import -m 'import a larger parent' import $svnrepo/larger-parent &&\n-        svn cp -m 'hi' $svnrepo/larger-parent $svnrepo/another-larger &&\n+        svn import -m \"import a larger parent\" import \"$svnrepo\"/larger-parent &&\n+        svn cp -m \"hi\" \"$svnrepo\"/larger-parent \"$svnrepo\"/another-larger &&\n         git-svn init --minimize-url -i larger \\\n-          $svnrepo/another-larger/trunk/thunk/bump/thud &&\n+          \"$svnrepo\"/another-larger/trunk/thunk/bump/thud &&\n         git-svn fetch -i larger &&\n         git rev-parse --verify refs/remotes/larger &&\n         git rev-parse --verify \\\n            refs/remotes/larger-parent/trunk/thunk/bump/thud &&\n-        test \\\"\\`git merge-base \\\n+        test \"`git merge-base \\\n                  refs/remotes/larger-parent/trunk/thunk/bump/thud \\\n-                 refs/remotes/larger\\`\\\" = \\\n-             \\\"\\`git rev-parse refs/remotes/larger\\`\\\"\n+                 refs/remotes/larger`\" = \\\n+             \"`git rev-parse refs/remotes/larger`\"\n         true\n-        \"\n+        '\n \n-test_expect_success 'follow higher-level parent' \"\n-        svn mkdir -m 'follow higher-level parent' $svnrepo/blob &&\n-        svn co $svnrepo/blob blob &&\n+test_expect_success 'follow higher-level parent' '\n+        svn mkdir -m \"follow higher-level parent\" \"$svnrepo\"/blob &&\n+        svn co \"$svnrepo\"/blob blob &&\n         cd blob &&\n                 echo hi > hi &&\n                 svn add hi &&\n-                svn commit -m 'hihi' &&\n+                svn commit -m \"hihi\" &&\n                 cd ..\n-        svn mkdir -m 'new glob at top level' $svnrepo/glob &&\n-        svn mv -m 'move blob down a level' $svnrepo/blob $svnrepo/glob/blob &&\n-        git-svn init --minimize-url -i blob $svnrepo/glob/blob &&\n+        svn mkdir -m \"new glob at top level\" \"$svnrepo\"/glob &&\n+        svn mv -m \"move blob down a level\" \"$svnrepo\"/blob \"$svnrepo\"/glob/blob &&\n+        git-svn init --minimize-url -i blob \"$svnrepo\"/glob/blob &&\n         git-svn fetch -i blob\n-        \"\n+        '\n \n-test_expect_success 'follow deleted directory' \"\n-\tsvn mv -m 'bye!' $svnrepo/glob/blob/hi $svnrepo/glob/blob/bye &&\n-\tsvn rm -m 'remove glob' $svnrepo/glob &&\n-\tgit-svn init --minimize-url -i glob $svnrepo/glob &&\n+test_expect_success 'follow deleted directory' '\n+\tsvn mv -m \"bye!\" \"$svnrepo\"/glob/blob/hi \"$svnrepo\"/glob/blob/bye &&\n+\tsvn rm -m \"remove glob\" \"$svnrepo\"/glob &&\n+\tgit-svn init --minimize-url -i glob \"$svnrepo\"/glob &&\n \tgit-svn fetch -i glob &&\n-\ttest \\\"\\`git cat-file blob refs/remotes/glob:blob/bye\\`\\\" = hi &&\n-\ttest \\\"\\`git ls-tree refs/remotes/glob | wc -l \\`\\\" -eq 1\n-\t\"\n+\ttest \"`git cat-file blob refs/remotes/glob:blob/bye`\" = hi &&\n+\ttest \"`git ls-tree refs/remotes/glob | wc -l `\" -eq 1\n+\t'\n \n # ref: r9270 of the Subversion repository: (http://svn.collab.net/repos/svn)\n # in trunk/subversion/bindings/swig/perl\n-test_expect_success 'follow-parent avoids deleting relevant info' \"\n+test_expect_success 'follow-parent avoids deleting relevant info' '\n \tmkdir -p import/trunk/subversion/bindings/swig/perl/t &&\n \tfor i in a b c ; do \\\n-\t  echo \\$i > import/trunk/subversion/bindings/swig/perl/\\$i.pm &&\n-\t  echo _\\$i > import/trunk/subversion/bindings/swig/perl/t/\\$i.t; \\\n+\t  echo $i > import/trunk/subversion/bindings/swig/perl/$i.pm &&\n+\t  echo _$i > import/trunk/subversion/bindings/swig/perl/t/$i.t; \\\n \tdone &&\n-\t  echo 'bad delete test' > \\\n+\t  echo \"bad delete test\" > \\\n \t   import/trunk/subversion/bindings/swig/perl/t/larger-parent &&\n-\t  echo 'bad delete test 2' > \\\n+\t  echo \"bad delete test 2\" > \\\n \t   import/trunk/subversion/bindings/swig/perl/another-larger &&\n \tcd import &&\n-\t  svn import -m 'r9270 test' . $svnrepo/r9270 &&\n+\t  svn import -m \"r9270 test\" . \"$svnrepo\"/r9270 &&\n \tcd .. &&\n-\tsvn co $svnrepo/r9270/trunk/subversion/bindings/swig/perl r9270 &&\n+\tsvn co \"$svnrepo\"/r9270/trunk/subversion/bindings/swig/perl r9270 &&\n \tcd r9270 &&\n \t  svn mkdir native &&\n \t  svn mv t native/t &&\n-\t  for i in a b c; do svn mv \\$i.pm native/\\$i.pm; done &&\n+\t  for i in a b c; do svn mv $i.pm native/$i.pm; done &&\n \t  echo z >> native/t/c.t &&\n \t  poke native/t/c.t &&\n-\t  svn commit -m 'reorg test' &&\n+\t  svn commit -m \"reorg test\" &&\n \tcd .. &&\n \tgit-svn init --minimize-url -i r9270-t \\\n-\t  $svnrepo/r9270/trunk/subversion/bindings/swig/perl/native/t &&\n+\t  \"$svnrepo\"/r9270/trunk/subversion/bindings/swig/perl/native/t &&\n \tgit-svn fetch -i r9270-t &&\n-\ttest \\`git rev-list r9270-t | wc -l\\` -eq 2 &&\n-\ttest \\\"\\`git ls-tree --name-only r9270-t~1\\`\\\" = \\\n-\t     \\\"\\`git ls-tree --name-only r9270-t\\`\\\"\n-\t\"\n+\ttest `git rev-list r9270-t | wc -l` -eq 2 &&\n+\ttest \"`git ls-tree --name-only r9270-t~1`\" = \\\n+\t     \"`git ls-tree --name-only r9270-t`\"\n+\t'\n \n-test_expect_success \"track initial change if it was only made to parent\" \"\n-\tsvn cp -m 'wheee!' $svnrepo/r9270/trunk $svnrepo/r9270/drunk &&\n+test_expect_success \"track initial change if it was only made to parent\" '\n+\tsvn cp -m \"wheee!\" \"$svnrepo\"/r9270/trunk \"$svnrepo\"/r9270/drunk &&\n \tgit-svn init --minimize-url -i r9270-d \\\n-\t  $svnrepo/r9270/drunk/subversion/bindings/swig/perl/native/t &&\n+\t  \"$svnrepo\"/r9270/drunk/subversion/bindings/swig/perl/native/t &&\n \tgit-svn fetch -i r9270-d &&\n-\ttest \\`git rev-list r9270-d | wc -l\\` -eq 3 &&\n-\ttest \\\"\\`git ls-tree --name-only r9270-t\\`\\\" = \\\n-\t     \\\"\\`git ls-tree --name-only r9270-d\\`\\\" &&\n-\ttest \\\"\\`git rev-parse r9270-t\\`\\\" = \\\n-\t     \\\"\\`git rev-parse r9270-d~1\\`\\\"\n-\t\"\n+\ttest `git rev-list r9270-d | wc -l` -eq 3 &&\n+\ttest \"`git ls-tree --name-only r9270-t`\" = \\\n+\t     \"`git ls-tree --name-only r9270-d`\" &&\n+\ttest \"`git rev-parse r9270-t`\" = \\\n+\t     \"`git rev-parse r9270-d~1`\"\n+\t'\n \n-test_expect_success \"track multi-parent paths\" \"\n-\tsvn cp -m 'resurrect /glob' $svnrepo/r9270 $svnrepo/glob &&\n+test_expect_success \"track multi-parent paths\" '\n+\tsvn cp -m \"resurrect /glob\" \"$svnrepo\"/r9270 \"$svnrepo\"/glob &&\n \tgit-svn multi-fetch &&\n-\ttest \\`git cat-file commit refs/remotes/glob | \\\n-\t       grep '^parent ' | wc -l\\` -eq 2\n-\t\"\n+\ttest `git cat-file commit refs/remotes/glob | \\\n+\t       grep \"^parent \" | wc -l` -eq 2\n+\t'\n \n test_expect_success \"multi-fetch continues to work\" \"\n \tgit-svn multi-fetch\n \t\"\n \n-test_expect_success \"multi-fetch works off a 'clean' repository\" \"\n-\trm -r $GIT_DIR/svn $GIT_DIR/refs/remotes $GIT_DIR/logs &&\n-\tmkdir $GIT_DIR/svn &&\n+test_expect_success \"multi-fetch works off a 'clean' repository\" '\n+\trm -r \"$GIT_DIR/svn\" \"$GIT_DIR/refs/remotes\" \"$GIT_DIR/logs\" &&\n+\tmkdir \"$GIT_DIR/svn\" &&\n \tgit-svn multi-fetch\n-\t\"\n+\t'\n \n test_debug 'gitk --all &'\n \ndiff --git a/t/t9105-git-svn-commit-diff.sh b/t/t9105-git-svn-commit-diff.sh\nindex 318e172..6323036 100755\n--- a/t/t9105-git-svn-commit-diff.sh\n+++ b/t/t9105-git-svn-commit-diff.sh\n@@ -4,18 +4,18 @@\n test_description='git-svn commit-diff'\n . ./lib-git-svn.sh\n \n-test_expect_success 'initialize repo' \"\n+test_expect_success 'initialize repo' '\n \tmkdir import &&\n \tcd import &&\n \techo hello > readme &&\n-\tsvn import -m 'initial' . $svnrepo &&\n+\tsvn import -m \"initial\" . \"$svnrepo\" &&\n \tcd .. &&\n \techo hello > readme &&\n \tgit update-index --add readme &&\n-\tgit commit -a -m 'initial' &&\n+\tgit commit -a -m \"initial\" &&\n \techo world >> readme &&\n-\tgit commit -a -m 'another'\n-\t\"\n+\tgit commit -a -m \"another\"\n+\t'\n \n head=`git rev-parse --verify HEAD^0`\n prev=`git rev-parse --verify HEAD^1`\n@@ -24,20 +24,20 @@ prev=`git rev-parse --verify HEAD^1`\n # commit, so only a basic test of functionality is needed since we've\n # already tested commit extensively elsewhere\n \n-test_expect_success 'test the commit-diff command' \"\n-\ttest -n '$prev' && test -n '$head' &&\n-\tgit-svn commit-diff -r1 '$prev' '$head' '$svnrepo' &&\n-\tsvn co $svnrepo wc &&\n+test_expect_success 'test the commit-diff command' '\n+\ttest -n \"$prev\" && test -n \"$head\" &&\n+\tgit-svn commit-diff -r1 \"$prev\" \"$head\" \"$svnrepo\" &&\n+\tsvn co \"$svnrepo\" wc &&\n \tcmp readme wc/readme\n-\t\"\n+\t'\n \n-test_expect_success 'commit-diff to a sub-directory (with git-svn config)' \"\n-\tsvn import -m 'sub-directory' import $svnrepo/subdir &&\n-\tgit-svn init --minimize-url $svnrepo/subdir &&\n+test_expect_success 'commit-diff to a sub-directory (with git-svn config)' '\n+\tsvn import -m \"sub-directory\" import \"$svnrepo\"/subdir &&\n+\tgit-svn init --minimize-url \"$svnrepo\"/subdir &&\n \tgit-svn fetch &&\n-\tgit-svn commit-diff -r3 '$prev' '$head' &&\n-\tsvn cat $svnrepo/subdir/readme > readme.2 &&\n+\tgit-svn commit-diff -r3 \"$prev\" \"$head\" &&\n+\tsvn cat \"$svnrepo\"/subdir/readme > readme.2 &&\n \tcmp readme readme.2\n-\t\"\n+\t'\n \n test_done\ndiff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh\nindex f74ab12..58a3a7b 100755\n--- a/t/t9106-git-svn-commit-diff-clobber.sh\n+++ b/t/t9106-git-svn-commit-diff-clobber.sh\n@@ -4,56 +4,56 @@\n test_description='git-svn commit-diff clobber'\n . ./lib-git-svn.sh\n \n-test_expect_success 'initialize repo' \"\n+test_expect_success 'initialize repo' '\n \tmkdir import &&\n \tcd import &&\n \techo initial > file &&\n-\tsvn import -m 'initial' . $svnrepo &&\n+\tsvn import -m \"initial\" . \"$svnrepo\" &&\n \tcd .. &&\n \techo initial > file &&\n \tgit update-index --add file &&\n-\tgit commit -a -m 'initial'\n-\t\"\n-test_expect_success 'commit change from svn side' \"\n-\tsvn co $svnrepo t.svn &&\n+\tgit commit -a -m \"initial\"\n+\t'\n+test_expect_success 'commit change from svn side' '\n+\tsvn co \"$svnrepo\" t.svn &&\n \tcd t.svn &&\n \techo second line from svn >> file &&\n \tpoke file &&\n-\tsvn commit -m 'second line from svn' &&\n+\tsvn commit -m \"second line from svn\" &&\n \tcd .. &&\n \trm -rf t.svn\n-\t\"\n+\t'\n \n-test_expect_success 'commit conflicting change from git' \"\n+test_expect_success 'commit conflicting change from git' '\n \techo second line from git >> file &&\n-\tgit commit -a -m 'second line from git' &&\n-\t! git-svn commit-diff -r1 HEAD~1 HEAD $svnrepo\n-\"\n+\tgit commit -a -m \"second line from git\" &&\n+\t! git-svn commit-diff -r1 HEAD~1 HEAD \"$svnrepo\"\n+'\n \n-test_expect_success 'commit complementing change from git' \"\n+test_expect_success 'commit complementing change from git' '\n \tgit reset --hard HEAD~1 &&\n \techo second line from svn >> file &&\n-\tgit commit -a -m 'second line from svn' &&\n+\tgit commit -a -m \"second line from svn\" &&\n \techo third line from git >> file &&\n-\tgit commit -a -m 'third line from git' &&\n-\tgit-svn commit-diff -r2 HEAD~1 HEAD $svnrepo\n-\t\"\n+\tgit commit -a -m \"third line from git\" &&\n+\tgit-svn commit-diff -r2 HEAD~1 HEAD \"$svnrepo\"\n+\t'\n \n-test_expect_success 'dcommit fails to commit because of conflict' \"\n-\tgit-svn init $svnrepo &&\n+test_expect_success 'dcommit fails to commit because of conflict' '\n+\tgit-svn init \"$svnrepo\" &&\n \tgit-svn fetch &&\n \tgit reset --hard refs/remotes/git-svn &&\n-\tsvn co $svnrepo t.svn &&\n+\tsvn co \"$svnrepo\" t.svn &&\n \tcd t.svn &&\n \techo fourth line from svn >> file &&\n \tpoke file &&\n-\tsvn commit -m 'fourth line from svn' &&\n+\tsvn commit -m \"fourth line from svn\" &&\n \tcd .. &&\n \trm -rf t.svn &&\n-\techo 'fourth line from git' >> file &&\n-\tgit commit -a -m 'fourth line from git' &&\n+\techo \"fourth line from git\" >> file &&\n+\tgit commit -a -m \"fourth line from git\" &&\n \t! git-svn dcommit\n-\t\"\n+\t'\n \n test_expect_success 'dcommit does the svn equivalent of an index merge' \"\n \tgit reset --hard refs/remotes/git-svn &&\n@@ -66,15 +66,15 @@ test_expect_success 'dcommit does the svn equivalent of an index merge' \"\n \tgit-svn dcommit\n \t\"\n \n-test_expect_success 'commit another change from svn side' \"\n-\tsvn co $svnrepo t.svn &&\n+test_expect_success 'commit another change from svn side' '\n+\tsvn co \"$svnrepo\" t.svn &&\n \tcd t.svn &&\n \t\techo third line from svn >> file &&\n \t\tpoke file &&\n-\t\tsvn commit -m 'third line from svn' &&\n+\t\tsvn commit -m \"third line from svn\" &&\n \tcd .. &&\n \trm -rf t.svn\n-\t\"\n+\t'\n \n test_expect_success 'multiple dcommit from git-svn will not clobber svn' \"\n \tgit reset --hard refs/remotes/git-svn &&\ndiff --git a/t/t9106-git-svn-dcommit-clobber-series.sh b/t/t9106-git-svn-dcommit-clobber-series.sh\nindex ca8a00e..a400dc7 100755\n--- a/t/t9106-git-svn-dcommit-clobber-series.sh\n+++ b/t/t9106-git-svn-dcommit-clobber-series.sh\n@@ -4,30 +4,30 @@\n test_description='git-svn dcommit clobber series'\n . ./lib-git-svn.sh\n \n-test_expect_success 'initialize repo' \"\n+test_expect_success 'initialize repo' '\n \tmkdir import &&\n \tcd import &&\n-\tawk 'BEGIN { for (i = 1; i < 64; i++) { print i } }' > file\n-\tsvn import -m 'initial' . $svnrepo &&\n+\tawk \"BEGIN { for (i = 1; i < 64; i++) { print i } }\" > file\n+\tsvn import -m \"initial\" . \"$svnrepo\" &&\n \tcd .. &&\n-\tgit svn init $svnrepo &&\n+\tgit svn init \"$svnrepo\" &&\n \tgit svn fetch &&\n \ttest -e file\n-\t\"\n+\t'\n \n-test_expect_success '(supposedly) non-conflicting change from SVN' \"\n-\ttest x\\\"\\`sed -n -e 58p < file\\`\\\" = x58 &&\n-\ttest x\\\"\\`sed -n -e 61p < file\\`\\\" = x61 &&\n-\tsvn co $svnrepo tmp &&\n+test_expect_success '(supposedly) non-conflicting change from SVN' '\n+\ttest x\"`sed -n -e 58p < file`\" = x58 &&\n+\ttest x\"`sed -n -e 61p < file`\" = x61 &&\n+\tsvn co \"$svnrepo\" tmp &&\n \tcd tmp &&\n-\t\tperl -i -p -e 's/^58\\$/5588/' file &&\n-\t\tperl -i -p -e 's/^61\\$/6611/' file &&\n+\t\tperl -i -p -e \"s/^58$/5588/\" file &&\n+\t\tperl -i -p -e \"s/^61$/6611/\" file &&\n \t\tpoke file &&\n-\t\ttest x\\\"\\`sed -n -e 58p < file\\`\\\" = x5588 &&\n-\t\ttest x\\\"\\`sed -n -e 61p < file\\`\\\" = x6611 &&\n-\t\tsvn commit -m '58 => 5588, 61 => 6611' &&\n+\t\ttest x\"`sed -n -e 58p < file`\" = x5588 &&\n+\t\ttest x\"`sed -n -e 61p < file`\" = x6611 &&\n+\t\tsvn commit -m \"58 => 5588, 61 => 6611\" &&\n \t\tcd ..\n-\t\"\n+\t'\n \n test_expect_success 'some unrelated changes to git' \"\n \techo hi > life &&\ndiff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh\nindex 0a41d52..d9b553a 100755\n--- a/t/t9107-git-svn-migrate.sh\n+++ b/t/t9107-git-svn-migrate.sh\n@@ -3,61 +3,61 @@\n test_description='git-svn metadata migrations from previous versions'\n . ./lib-git-svn.sh\n \n-test_expect_success 'setup old-looking metadata' \"\n-\tcp $GIT_DIR/config $GIT_DIR/config-old-git-svn &&\n+test_expect_success 'setup old-looking metadata' '\n+\tcp \"$GIT_DIR\"/config \"$GIT_DIR\"/config-old-git-svn &&\n \tmkdir import &&\n \tcd import &&\n \t\tfor i in trunk branches/a branches/b \\\n \t\t         tags/0.1 tags/0.2 tags/0.3; do\n-\t\t\tmkdir -p \\$i && \\\n-\t\t\techo hello >> \\$i/README || exit 1\n+\t\t\tmkdir -p $i && \\\n+\t\t\techo hello >> $i/README || exit 1\n \t\tdone && \\\n-\t\tsvn import -m test . $svnrepo\n+\t\tsvn import -m test . \"$svnrepo\"\n \t\tcd .. &&\n-\tgit-svn init $svnrepo &&\n+\tgit-svn init \"$svnrepo\" &&\n \tgit-svn fetch &&\n-\tmv $GIT_DIR/svn/* $GIT_DIR/ &&\n-\tmv $GIT_DIR/svn/.metadata $GIT_DIR/ &&\n-\trmdir $GIT_DIR/svn &&\n+\tmv \"$GIT_DIR\"/svn/* \"$GIT_DIR\"/ &&\n+\tmv \"$GIT_DIR\"/svn/.metadata \"$GIT_DIR\"/ &&\n+\trmdir \"$GIT_DIR\"/svn &&\n \tgit update-ref refs/heads/git-svn-HEAD refs/remotes/git-svn &&\n \tgit update-ref refs/heads/svn-HEAD refs/remotes/git-svn &&\n \tgit update-ref -d refs/remotes/git-svn refs/remotes/git-svn\n-\t\"\n+\t'\n \n head=`git rev-parse --verify refs/heads/git-svn-HEAD^0`\n test_expect_success 'git-svn-HEAD is a real HEAD' \"test -n '$head'\"\n \n-test_expect_success 'initialize old-style (v0) git-svn layout' \"\n-\tmkdir -p $GIT_DIR/git-svn/info $GIT_DIR/svn/info &&\n-\techo $svnrepo > $GIT_DIR/git-svn/info/url &&\n-\techo $svnrepo > $GIT_DIR/svn/info/url &&\n+test_expect_success 'initialize old-style (v0) git-svn layout' '\n+\tmkdir -p \"$GIT_DIR\"/git-svn/info \"$GIT_DIR\"/svn/info &&\n+\techo \"$svnrepo\" > \"$GIT_DIR\"/git-svn/info/url &&\n+\techo \"$svnrepo\" > \"$GIT_DIR\"/svn/info/url &&\n \tgit-svn migrate &&\n-\t! test -d $GIT_DIR/git-svn &&\n+\t! test -d \"$GIT_DIR\"/git-svn &&\n \tgit rev-parse --verify refs/remotes/git-svn^0 &&\n \tgit rev-parse --verify refs/remotes/svn^0 &&\n-\ttest \\`git config --get svn-remote.svn.url\\` = '$svnrepo' &&\n-\ttest \\`git config --get svn-remote.svn.fetch\\` = \\\n-             ':refs/remotes/git-svn'\n-\t\"\n+\ttest \"$(git config --get svn-remote.svn.url)\" = \"$svnrepo\" &&\n+\ttest `git config --get svn-remote.svn.fetch` = \\\n+             \":refs/remotes/git-svn\"\n+\t'\n \n-test_expect_success 'initialize a multi-repository repo' \"\n-\tgit-svn init $svnrepo -T trunk -t tags -b branches &&\n+test_expect_success 'initialize a multi-repository repo' '\n+\tgit-svn init \"$svnrepo\" -T trunk -t tags -b branches &&\n \tgit config --get-all svn-remote.svn.fetch > fetch.out &&\n-\tgrep '^trunk:refs/remotes/trunk$' fetch.out &&\n-\ttest -n \\\"\\`git config --get svn-remote.svn.branches \\\n-\t            '^branches/\\*:refs/remotes/\\*$'\\`\\\" &&\n-\ttest -n \\\"\\`git config --get svn-remote.svn.tags \\\n-\t            '^tags/\\*:refs/remotes/tags/\\*$'\\`\\\" &&\n+\tgrep \"^trunk:refs/remotes/trunk$\" fetch.out &&\n+\ttest -n \"`git config --get svn-remote.svn.branches \\\n+\t            \"^branches/\\*:refs/remotes/\\*$\"`\" &&\n+\ttest -n \"`git config --get svn-remote.svn.tags \\\n+\t            \"^tags/\\*:refs/remotes/tags/\\*$\"`\" &&\n \tgit config --unset svn-remote.svn.branches \\\n-\t                        '^branches/\\*:refs/remotes/\\*$' &&\n+\t                        \"^branches/\\*:refs/remotes/\\*$\" &&\n \tgit config --unset svn-remote.svn.tags \\\n-\t                        '^tags/\\*:refs/remotes/tags/\\*$' &&\n-\tgit config --add svn-remote.svn.fetch 'branches/a:refs/remotes/a' &&\n-\tgit config --add svn-remote.svn.fetch 'branches/b:refs/remotes/b' &&\n+\t                        \"^tags/\\*:refs/remotes/tags/\\*$\" &&\n+\tgit config --add svn-remote.svn.fetch \"branches/a:refs/remotes/a\" &&\n+\tgit config --add svn-remote.svn.fetch \"branches/b:refs/remotes/b\" &&\n \tfor i in tags/0.1 tags/0.2 tags/0.3; do\n \t\tgit config --add svn-remote.svn.fetch \\\n-\t\t                 \\$i:refs/remotes/\\$i || exit 1; done\n-\t\"\n+\t\t                 $i:refs/remotes/$i || exit 1; done\n+\t'\n \n # refs should all be different, but the trees should all be the same:\n test_expect_success 'multi-fetch works on partial urls + paths' \"\n@@ -73,43 +73,43 @@ test_expect_success 'multi-fetch works on partial urls + paths' \"\n \t                         refs/remotes/\\$j\\`\\\" ||exit 1; done; done\n \t\"\n \n-test_expect_success 'migrate --minimize on old inited layout' \"\n+test_expect_success 'migrate --minimize on old inited layout' '\n \tgit config --unset-all svn-remote.svn.fetch &&\n \tgit config --unset-all svn-remote.svn.url &&\n-\trm -rf $GIT_DIR/svn &&\n-\tfor i in \\`cat fetch.out\\`; do\n-\t\tpath=\\`expr \\$i : '\\\\([^:]*\\\\):.*$'\\`\n-\t\tref=\\`expr \\$i : '[^:]*:refs/remotes/\\\\(.*\\\\)$'\\`\n-\t\tif test -z \\\"\\$ref\\\"; then continue; fi\n-\t\tif test -n \\\"\\$path\\\"; then path=\\\"/\\$path\\\"; fi\n-\t\t( mkdir -p $GIT_DIR/svn/\\$ref/info/ &&\n-\t\techo $svnrepo\\$path > $GIT_DIR/svn/\\$ref/info/url ) || exit 1;\n+\trm -rf \"$GIT_DIR\"/svn &&\n+\tfor i in `cat fetch.out`; do\n+\t\tpath=`expr $i : \"\\([^:]*\\):.*$\"`\n+\t\tref=`expr $i : \"[^:]*:refs/remotes/\\(.*\\)$\"`\n+\t\tif test -z \"$ref\"; then continue; fi\n+\t\tif test -n \"$path\"; then path=\"/$path\"; fi\n+\t\t( mkdir -p \"$GIT_DIR\"/svn/$ref/info/ &&\n+\t\techo \"$svnrepo\"$path > \"$GIT_DIR\"/svn/$ref/info/url ) || exit 1;\n \tdone &&\n \tgit-svn migrate --minimize &&\n-\ttest -z \\\"\\`git config -l |grep -v '^svn-remote\\.git-svn\\.'\\`\\\" &&\n+\ttest -z \"`git config -l |grep -v \"^svn-remote\\.git-svn\\.\"`\" &&\n \tgit config --get-all svn-remote.svn.fetch > fetch.out &&\n-\tgrep '^trunk:refs/remotes/trunk$' fetch.out &&\n-\tgrep '^branches/a:refs/remotes/a$' fetch.out &&\n-\tgrep '^branches/b:refs/remotes/b$' fetch.out &&\n-\tgrep '^tags/0\\.1:refs/remotes/tags/0\\.1$' fetch.out &&\n-\tgrep '^tags/0\\.2:refs/remotes/tags/0\\.2$' fetch.out &&\n-\tgrep '^tags/0\\.3:refs/remotes/tags/0\\.3$' fetch.out\n-\tgrep '^:refs/remotes/git-svn' fetch.out\n-\t\"\n+\tgrep \"^trunk:refs/remotes/trunk$\" fetch.out &&\n+\tgrep \"^branches/a:refs/remotes/a$\" fetch.out &&\n+\tgrep \"^branches/b:refs/remotes/b$\" fetch.out &&\n+\tgrep \"^tags/0\\.1:refs/remotes/tags/0\\.1$\" fetch.out &&\n+\tgrep \"^tags/0\\.2:refs/remotes/tags/0\\.2$\" fetch.out &&\n+\tgrep \"^tags/0\\.3:refs/remotes/tags/0\\.3$\" fetch.out\n+\tgrep \"^:refs/remotes/git-svn\" fetch.out\n+\t'\n \n-test_expect_success  \".rev_db auto-converted to .rev_map.UUID\" \"\n+test_expect_success  \".rev_db auto-converted to .rev_map.UUID\" '\n \tgit-svn fetch -i trunk &&\n-\ttest -z \\\"\\$(ls $GIT_DIR/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n-\texpect=\\\"\\$(ls $GIT_DIR/svn/trunk/.rev_map.*)\\\" &&\n-\ttest -n \\\"\\$expect\\\" &&\n-\trev_db=\\$(echo \\$expect | sed -e 's,_map,_db,') &&\n-\tconvert_to_rev_db \\$expect \\$rev_db &&\n-\trm -f \\$expect &&\n-\ttest -f \\$rev_db &&\n+\ttest -z \"$(ls \"$GIT_DIR\"/svn/trunk/.rev_db.* 2>/dev/null)\" &&\n+\texpect=\"$(ls \"$GIT_DIR\"/svn/trunk/.rev_map.*)\" &&\n+\ttest -n \"$expect\" &&\n+\trev_db=\"$(echo $expect | sed -e \"s,_map,_db,\")\" &&\n+\tconvert_to_rev_db \"$expect\" \"$rev_db\" &&\n+\trm -f \"$expect\" &&\n+\ttest -f \"$rev_db\" &&\n \tgit-svn fetch -i trunk &&\n-\ttest -z \\\"\\$(ls $GIT_DIR/svn/trunk/.rev_db.* 2>/dev/null)\\\" &&\n-\ttest ! -e $GIT_DIR/svn/trunk/.rev_db &&\n-\ttest -f \\$expect\n-\t\"\n+\ttest -z \"$(ls \"$GIT_DIR\"/svn/trunk/.rev_db.* 2>/dev/null)\" &&\n+\ttest ! -e \"$GIT_DIR\"/svn/trunk/.rev_db &&\n+\ttest -f \"$expect\"\n+\t'\n \n test_done\ndiff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh\nindex db4344c..f6f71d0 100755\n--- a/t/t9108-git-svn-glob.sh\n+++ b/t/t9108-git-svn-glob.sh\n@@ -10,77 +10,77 @@ start a new branch\n initial\n EOF\n \n-test_expect_success 'test refspec globbing' \"\n+test_expect_success 'test refspec globbing' '\n \tmkdir -p trunk/src/a trunk/src/b trunk/doc &&\n-\techo 'hello world' > trunk/src/a/readme &&\n-\techo 'goodbye world' > trunk/src/b/readme &&\n-\tsvn import -m 'initial' trunk $svnrepo/trunk &&\n-\tsvn co $svnrepo tmp &&\n+\techo \"hello world\" > trunk/src/a/readme &&\n+\techo \"goodbye world\" > trunk/src/b/readme &&\n+\tsvn import -m \"initial\" trunk \"$svnrepo\"/trunk &&\n+\tsvn co \"$svnrepo\" tmp &&\n \tcd tmp &&\n \t\tmkdir branches tags &&\n \t\tsvn add branches tags &&\n \t\tsvn cp trunk branches/start &&\n-\t\tsvn commit -m 'start a new branch' &&\n+\t\tsvn commit -m \"start a new branch\" &&\n \t\tsvn up &&\n-\t\techo 'hi' >> branches/start/src/b/readme &&\n+\t\techo \"hi\" >> branches/start/src/b/readme &&\n \t\tpoke branches/start/src/b/readme &&\n-\t\techo 'hey' >> branches/start/src/a/readme &&\n+\t\techo \"hey\" >> branches/start/src/a/readme &&\n \t\tpoke branches/start/src/a/readme &&\n-\t\tsvn commit -m 'hi' &&\n+\t\tsvn commit -m \"hi\" &&\n \t\tsvn up &&\n \t\tsvn cp branches/start tags/end &&\n-\t\techo 'bye' >> tags/end/src/b/readme &&\n+\t\techo \"bye\" >> tags/end/src/b/readme &&\n \t\tpoke tags/end/src/b/readme &&\n-\t\techo 'aye' >> tags/end/src/a/readme &&\n+\t\techo \"aye\" >> tags/end/src/a/readme &&\n \t\tpoke tags/end/src/a/readme &&\n-\t\tsvn commit -m 'the end' &&\n-\t\techo 'byebye' >> tags/end/src/b/readme &&\n+\t\tsvn commit -m \"the end\" &&\n+\t\techo \"byebye\" >> tags/end/src/b/readme &&\n \t\tpoke tags/end/src/b/readme &&\n-\t\tsvn commit -m 'nothing to see here'\n+\t\tsvn commit -m \"nothing to see here\"\n \t\tcd .. &&\n-\tgit config --add svn-remote.svn.url $svnrepo &&\n+\tgit config --add svn-remote.svn.url \"$svnrepo\" &&\n \tgit config --add svn-remote.svn.fetch \\\n-\t                 'trunk/src/a:refs/remotes/trunk' &&\n+\t                 \"trunk/src/a:refs/remotes/trunk\" &&\n \tgit config --add svn-remote.svn.branches \\\n-\t                 'branches/*/src/a:refs/remotes/branches/*' &&\n+\t                 \"branches/*/src/a:refs/remotes/branches/*\" &&\n \tgit config --add svn-remote.svn.tags\\\n-\t                 'tags/*/src/a:refs/remotes/tags/*' &&\n+\t                 \"tags/*/src/a:refs/remotes/tags/*\" &&\n \tgit-svn multi-fetch &&\n \tgit log --pretty=oneline refs/remotes/tags/end | \\\n-\t    sed -e 's/^.\\{41\\}//' > output.end &&\n+\t    sed -e \"s/^.\\{41\\}//\" > output.end &&\n \tcmp expect.end output.end &&\n-\ttest \\\"\\`git rev-parse refs/remotes/tags/end~1\\`\\\" = \\\n-\t\t\\\"\\`git rev-parse refs/remotes/branches/start\\`\\\" &&\n-\ttest \\\"\\`git rev-parse refs/remotes/branches/start~2\\`\\\" = \\\n-\t\t\\\"\\`git rev-parse refs/remotes/trunk\\`\\\"\n-\t\"\n+\ttest \"`git rev-parse refs/remotes/tags/end~1`\" = \\\n+\t\t\"`git rev-parse refs/remotes/branches/start`\" &&\n+\ttest \"`git rev-parse refs/remotes/branches/start~2`\" = \\\n+\t\t\"`git rev-parse refs/remotes/trunk`\"\n+\t'\n \n echo try to try > expect.two\n echo nothing to see here >> expect.two\n cat expect.end >> expect.two\n \n-test_expect_success 'test left-hand-side only globbing' \"\n-\tgit config --add svn-remote.two.url $svnrepo &&\n+test_expect_success 'test left-hand-side only globbing' '\n+\tgit config --add svn-remote.two.url \"$svnrepo\" &&\n \tgit config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk &&\n \tgit config --add svn-remote.two.branches \\\n-\t                 'branches/*:refs/remotes/two/branches/*' &&\n+\t                 \"branches/*:refs/remotes/two/branches/*\" &&\n \tgit config --add svn-remote.two.tags \\\n-\t                 'tags/*:refs/remotes/two/tags/*' &&\n+\t                 \"tags/*:refs/remotes/two/tags/*\" &&\n \tcd tmp &&\n-\t\techo 'try try' >> tags/end/src/b/readme &&\n+\t\techo \"try try\" >> tags/end/src/b/readme &&\n \t\tpoke tags/end/src/b/readme &&\n-\t\tsvn commit -m 'try to try'\n+\t\tsvn commit -m \"try to try\"\n \t\tcd .. &&\n \tgit-svn fetch two &&\n-\ttest \\`git rev-list refs/remotes/two/tags/end | wc -l\\` -eq 6 &&\n-\ttest \\`git rev-list refs/remotes/two/branches/start | wc -l\\` -eq 3 &&\n-\ttest \\`git rev-parse refs/remotes/two/branches/start~2\\` = \\\n-\t     \\`git rev-parse refs/remotes/two/trunk\\` &&\n-\ttest \\`git rev-parse refs/remotes/two/tags/end~3\\` = \\\n-\t     \\`git rev-parse refs/remotes/two/branches/start\\` &&\n+\ttest `git rev-list refs/remotes/two/tags/end | wc -l` -eq 6 &&\n+\ttest `git rev-list refs/remotes/two/branches/start | wc -l` -eq 3 &&\n+\ttest `git rev-parse refs/remotes/two/branches/start~2` = \\\n+\t     `git rev-parse refs/remotes/two/trunk` &&\n+\ttest `git rev-parse refs/remotes/two/tags/end~3` = \\\n+\t     `git rev-parse refs/remotes/two/branches/start` &&\n \tgit log --pretty=oneline refs/remotes/two/tags/end | \\\n-\t    sed -e 's/^.\\{41\\}//' > output.two &&\n+\t    sed -e \"s/^.\\{41\\}//\" > output.two &&\n \tcmp expect.two output.two\n-\t\"\n+\t'\n \n test_done\ndiff --git a/t/t9110-git-svn-use-svm-props.sh b/t/t9110-git-svn-use-svm-props.sh\nindex 6235af4..047659f 100755\n--- a/t/t9110-git-svn-use-svm-props.sh\n+++ b/t/t9110-git-svn-use-svm-props.sh\n@@ -7,15 +7,15 @@ test_description='git-svn useSvmProps test'\n \n . ./lib-git-svn.sh\n \n-test_expect_success 'load svm repo' \"\n-\tsvnadmin load -q $rawsvnrepo < ../t9110/svm.dump &&\n-\tgit-svn init --minimize-url -R arr -i bar $svnrepo/mirror/arr &&\n-\tgit-svn init --minimize-url -R argh -i dir $svnrepo/mirror/argh &&\n+test_expect_success 'load svm repo' '\n+\tsvnadmin load -q \"$rawsvnrepo\" < ../t9110/svm.dump &&\n+\tgit-svn init --minimize-url -R arr -i bar \"$svnrepo\"/mirror/arr &&\n+\tgit-svn init --minimize-url -R argh -i dir \"$svnrepo\"/mirror/argh &&\n \tgit-svn init --minimize-url -R argh -i e \\\n-\t  $svnrepo/mirror/argh/a/b/c/d/e &&\n+\t  \"$svnrepo\"/mirror/argh/a/b/c/d/e &&\n \tgit config svn.useSvmProps true &&\n \tgit-svn fetch --all\n-\t\"\n+\t'\n \n uuid=161ce429-a9dd-4828-af4a-52023f968c89\n \ndiff --git a/t/t9111-git-svn-use-svnsync-props.sh b/t/t9111-git-svn-use-svnsync-props.sh\nindex ec7dedd..a8d74dc 100755\n--- a/t/t9111-git-svn-use-svnsync-props.sh\n+++ b/t/t9111-git-svn-use-svnsync-props.sh\n@@ -7,14 +7,14 @@ test_description='git-svn useSvnsyncProps test'\n \n . ./lib-git-svn.sh\n \n-test_expect_success 'load svnsync repo' \"\n-\tsvnadmin load -q $rawsvnrepo < ../t9111/svnsync.dump &&\n-\tgit-svn init --minimize-url -R arr -i bar $svnrepo/bar &&\n-\tgit-svn init --minimize-url -R argh -i dir $svnrepo/dir &&\n-\tgit-svn init --minimize-url -R argh -i e $svnrepo/dir/a/b/c/d/e &&\n+test_expect_success 'load svnsync repo' '\n+\tsvnadmin load -q \"$rawsvnrepo\" < ../t9111/svnsync.dump &&\n+\tgit-svn init --minimize-url -R arr -i bar \"$svnrepo\"/bar &&\n+\tgit-svn init --minimize-url -R argh -i dir \"$svnrepo\"/dir &&\n+\tgit-svn init --minimize-url -R argh -i e \"$svnrepo\"/dir/a/b/c/d/e &&\n \tgit config svn.useSvnsyncProps true &&\n \tgit-svn fetch --all\n-\t\"\n+\t'\n \n uuid=161ce429-a9dd-4828-af4a-52023f968c89\n \ndiff --git a/t/t9112-git-svn-md5less-file.sh b/t/t9112-git-svn-md5less-file.sh\nindex 646a5f0..d470a92 100755\n--- a/t/t9112-git-svn-md5less-file.sh\n+++ b/t/t9112-git-svn-md5less-file.sh\n@@ -40,8 +40,8 @@ PROPS-END\n \n EOF\n \n-test_expect_success 'load svn dumpfile' \"svnadmin load $rawsvnrepo < dumpfile.svn\"\n+test_expect_success 'load svn dumpfile' 'svnadmin load \"$rawsvnrepo\" < dumpfile.svn'\n \n-test_expect_success 'initialize git-svn' \"git-svn init $svnrepo\"\n+test_expect_success 'initialize git-svn' 'git-svn init \"$svnrepo\"'\n test_expect_success 'fetch revisions from svn' 'git-svn fetch'\n test_done\ndiff --git a/t/t9113-git-svn-dcommit-new-file.sh b/t/t9113-git-svn-dcommit-new-file.sh\nindex 9ef0db9..31c929b 100755\n--- a/t/t9113-git-svn-dcommit-new-file.sh\n+++ b/t/t9113-git-svn-dcommit-new-file.sh\n@@ -15,18 +15,18 @@ test_description='git-svn dcommit new files over svn:// test'\n \n start_svnserve () {\n \tsvnserve --listen-port $SVNSERVE_PORT \\\n-\t         --root $rawsvnrepo \\\n+\t         --root \"$rawsvnrepo\" \\\n \t         --listen-once \\\n \t         --listen-host 127.0.0.1 &\n }\n \n-test_expect_success 'start tracking an empty repo' \"\n-\tsvn mkdir -m 'empty dir' $svnrepo/empty-dir &&\n-\techo anon-access = write >> $rawsvnrepo/conf/svnserve.conf &&\n+test_expect_success 'start tracking an empty repo' '\n+\tsvn mkdir -m \"empty dir\" \"$svnrepo\"/empty-dir &&\n+\techo anon-access = write >> \"$rawsvnrepo\"/conf/svnserve.conf &&\n \tstart_svnserve &&\n \tgit svn init svn://127.0.0.1:$SVNSERVE_PORT &&\n \tgit svn fetch\n-\t\"\n+\t'\n \n test_expect_success 'create files in new directory with dcommit' \"\n \tmkdir git-new-dir &&\ndiff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh\nindex 225060b..61d7781 100755\n--- a/t/t9114-git-svn-dcommit-merge.sh\n+++ b/t/t9114-git-svn-dcommit-merge.sh\n@@ -34,35 +34,35 @@ cat << EOF\n EOF\n }\n \n-test_expect_success 'setup svn repository' \"\n-\tsvn co $svnrepo mysvnwork &&\n+test_expect_success 'setup svn repository' '\n+\tsvn co \"$svnrepo\" mysvnwork &&\n \tmkdir -p mysvnwork/trunk &&\n \tcd mysvnwork &&\n \t\tbig_text_block >> trunk/README &&\n \t\tsvn add trunk &&\n-\t\tsvn ci -m 'first commit' trunk &&\n+\t\tsvn ci -m \"first commit\" trunk &&\n \t\tcd ..\n-\t\"\n+\t'\n \n-test_expect_success 'setup git mirror and merge' \"\n-\tgit svn init $svnrepo -t tags -T trunk -b branches &&\n+test_expect_success 'setup git mirror and merge' '\n+\tgit svn init \"$svnrepo\" -t tags -T trunk -b branches &&\n \tgit svn fetch &&\n \tgit checkout --track -b svn remotes/trunk &&\n \tgit checkout -b merge &&\n \techo new file > new_file &&\n \tgit add new_file &&\n-\tgit commit -a -m 'New file' &&\n+\tgit commit -a -m \"New file\" &&\n \techo hello >> README &&\n-\tgit commit -a -m 'hello' &&\n+\tgit commit -a -m \"hello\" &&\n \techo add some stuff >> new_file &&\n-\tgit commit -a -m 'add some stuff' &&\n+\tgit commit -a -m \"add some stuff\" &&\n \tgit checkout svn &&\n \tmv -f README tmp &&\n \techo friend > README &&\n \tcat tmp >> README &&\n-\tgit commit -a -m 'friend' &&\n+\tgit commit -a -m \"friend\" &&\n \tgit pull . merge\n-\t\"\n+\t'\n \n test_debug 'gitk --all & sleep 1'\n \ndiff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh\nindex 182299c..298445f 100755\n--- a/t/t9115-git-svn-dcommit-funky-renames.sh\n+++ b/t/t9115-git-svn-dcommit-funky-renames.sh\n@@ -7,16 +7,16 @@ test_description='git-svn dcommit can commit renames of files with ugly names'\n \n . ./lib-git-svn.sh\n \n-test_expect_success 'load repository with strange names' \"\n-\tsvnadmin load -q $rawsvnrepo < ../t9115/funky-names.dump &&\n+test_expect_success 'load repository with strange names' '\n+\tsvnadmin load -q \"$rawsvnrepo\" < ../t9115/funky-names.dump &&\n \tstart_httpd\n-\t\"\n+\t'\n \n-test_expect_success 'init and fetch repository' \"\n-\tgit svn init $svnrepo &&\n+test_expect_success 'init and fetch repository' '\n+\tgit svn init \"$svnrepo\" &&\n \tgit svn fetch &&\n \tgit reset --hard git-svn\n-\t\"\n+\t'\n \n test_expect_success 'create file in existing ugly and empty dir' '\n \tmkdir \"#{bad_directory_name}\" &&\ndiff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh\nindex e1e8bdf..4b2cc87 100755\n--- a/t/t9116-git-svn-log.sh\n+++ b/t/t9116-git-svn-log.sh\n@@ -6,17 +6,17 @@\n test_description='git-svn log tests'\n . ./lib-git-svn.sh\n \n-test_expect_success 'setup repository and import' \"\n+test_expect_success 'setup repository and import' '\n \tmkdir import &&\n \tcd import &&\n \t\tfor i in trunk branches/a branches/b \\\n \t\t         tags/0.1 tags/0.2 tags/0.3; do\n-\t\t\tmkdir -p \\$i && \\\n-\t\t\techo hello >> \\$i/README || exit 1\n+\t\t\tmkdir -p $i && \\\n+\t\t\techo hello >> $i/README || exit 1\n \t\tdone && \\\n-\t\tsvn import -m test . $svnrepo\n+\t\tsvn import -m test . \"$svnrepo\"\n \t\tcd .. &&\n-\tgit-svn init $svnrepo -T trunk -b branches -t tags &&\n+\tgit-svn init \"$svnrepo\" -T trunk -b branches -t tags &&\n \tgit-svn fetch &&\n \tgit reset --hard trunk &&\n \techo bye >> README &&\n@@ -37,7 +37,7 @@ test_expect_success 'setup repository and import' \"\n \techo try >> README &&\n \tgit commit -a -m try &&\n \tgit svn dcommit\n-\t\"\n+\t'\n \n test_expect_success 'run log' \"\n \tgit reset --hard a &&\ndiff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh\nindex d482b40..7a689bb 100755\n--- a/t/t9117-git-svn-init-clone.sh\n+++ b/t/t9117-git-svn-init-clone.sh\n@@ -13,43 +13,43 @@ rm -r .git\n mkdir tmp\n cd tmp\n \n-test_expect_success 'setup svnrepo' \"\n+test_expect_success 'setup svnrepo' '\n \tmkdir project project/trunk project/branches project/tags &&\n \techo foo > project/trunk/foo &&\n-\tsvn import -m '$test_description' project $svnrepo/project &&\n+\tsvn import -m \"$test_description\" project \"$svnrepo\"/project &&\n \trm -rf project\n-\t\"\n+\t'\n \n-test_expect_success 'basic clone' \"\n+test_expect_success 'basic clone' '\n \ttest ! -d trunk &&\n-\tgit svn clone $svnrepo/project/trunk &&\n+\tgit svn clone \"$svnrepo\"/project/trunk &&\n \ttest -d trunk/.git/svn &&\n \ttest -e trunk/foo &&\n \trm -rf trunk\n-\t\"\n+\t'\n \n-test_expect_success 'clone to target directory' \"\n+test_expect_success 'clone to target directory' '\n \ttest ! -d target &&\n-\tgit svn clone $svnrepo/project/trunk target &&\n+\tgit svn clone \"$svnrepo\"/project/trunk target &&\n \ttest -d target/.git/svn &&\n \ttest -e target/foo &&\n \trm -rf target\n-\t\"\n+\t'\n \n-test_expect_success 'clone with --stdlayout' \"\n+test_expect_success 'clone with --stdlayout' '\n \ttest ! -d project &&\n-\tgit svn clone -s $svnrepo/project &&\n+\tgit svn clone -s \"$svnrepo\"/project &&\n \ttest -d project/.git/svn &&\n \ttest -e project/foo &&\n \trm -rf project\n-\t\"\n+\t'\n \n-test_expect_success 'clone to target directory with --stdlayout' \"\n+test_expect_success 'clone to target directory with --stdlayout' '\n \ttest ! -d target &&\n-\tgit svn clone -s $svnrepo/project target &&\n+\tgit svn clone -s \"$svnrepo\"/project target &&\n \ttest -d target/.git/svn &&\n \ttest -e target/foo &&\n \trm -rf target\n-\t\"\n+\t'\n \n test_done\ndiff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh\nindex 640bb06..3281cbd 100755\n--- a/t/t9118-git-svn-funky-branch-names.sh\n+++ b/t/t9118-git-svn-funky-branch-names.sh\n@@ -6,25 +6,25 @@\n test_description='git-svn funky branch names'\n . ./lib-git-svn.sh\n \n-test_expect_success 'setup svnrepo' \"\n+test_expect_success 'setup svnrepo' '\n \tmkdir project project/trunk project/branches project/tags &&\n \techo foo > project/trunk/foo &&\n-\tsvn import -m '$test_description' project \\\"$svnrepo/pr ject\\\" &&\n+\tsvn import -m \"$test_description\" project \"$svnrepo/pr ject\" &&\n \trm -rf project &&\n-\tsvn cp -m 'fun' \\\"$svnrepo/pr ject/trunk\\\" \\\n-\t                \\\"$svnrepo/pr ject/branches/fun plugin\\\" &&\n-\tsvn cp -m 'more fun!' \\\"$svnrepo/pr ject/branches/fun plugin\\\" \\\n-\t                      \\\"$svnrepo/pr ject/branches/more fun plugin!\\\" &&\n+\tsvn cp -m \"fun\" \"$svnrepo/pr ject/trunk\" \\\n+\t                \"$svnrepo/pr ject/branches/fun plugin\" &&\n+\tsvn cp -m \"more fun!\" \"$svnrepo/pr ject/branches/fun plugin\" \\\n+\t                      \"$svnrepo/pr ject/branches/more fun plugin!\" &&\n \tstart_httpd\n-\t\"\n+\t'\n \n-test_expect_success 'test clone with funky branch names' \"\n-\tgit svn clone -s \\\"$svnrepo/pr ject\\\" project &&\n+test_expect_success 'test clone with funky branch names' '\n+\tgit svn clone -s \"$svnrepo/pr ject\" project &&\n \tcd project &&\n-\t\tgit rev-parse 'refs/remotes/fun%20plugin' &&\n-\t\tgit rev-parse 'refs/remotes/more%20fun%20plugin!' &&\n+\t\tgit rev-parse \"refs/remotes/fun%20plugin\" &&\n+\t\tgit rev-parse \"refs/remotes/more%20fun%20plugin!\" &&\n \tcd ..\n-\t\"\n+\t'\n \n test_expect_success 'test dcommit to funky branch' \"\n \tcd project &&\ndiff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh\nindex 9a4eabe..5979e13 100755\n--- a/t/t9120-git-svn-clone-with-percent-escapes.sh\n+++ b/t/t9120-git-svn-clone-with-percent-escapes.sh\n@@ -6,13 +6,13 @@\n test_description='git-svn clone with percent escapes'\n . ./lib-git-svn.sh\n \n-test_expect_success 'setup svnrepo' \"\n+test_expect_success 'setup svnrepo' '\n \tmkdir project project/trunk project/branches project/tags &&\n \techo foo > project/trunk/foo &&\n-\tsvn import -m '$test_description' project '$svnrepo/pr ject' &&\n+\tsvn import -m \"$test_description\" project \"$svnrepo/pr ject\" &&\n \trm -rf project &&\n \tstart_httpd\n-\"\n+'\n \n if test \"$SVN_HTTPD_PORT\" = \"\"\n then\ndiff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\nindex 3dc261d..ae7082b 100755\n--- a/t/t9500-gitweb-standalone-no-errors.sh\n+++ b/t/t9500-gitweb-standalone-no-errors.sh\n@@ -10,6 +10,7 @@ commandline, and checks that it would not write any errors\n or warnings to log.'\n \n gitweb_init () {\n+\tsafe_pwd=\"$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')\"\n \tcat >gitweb_config.perl <<EOF\n #!/usr/bin/perl\n \n@@ -17,16 +18,16 @@ gitweb_init () {\n \n our \\$version = \"current\";\n our \\$GIT = \"git\";\n-our \\$projectroot = \"$(pwd)\";\n+our \\$projectroot = \"$safe_pwd\";\n our \\$project_maxdepth = 8;\n our \\$home_link_str = \"projects\";\n our \\$site_name = \"[localhost]\";\n our \\$site_header = \"\";\n our \\$site_footer = \"\";\n our \\$home_text = \"indextext.html\";\n-our @stylesheets = (\"file:///$(pwd)/../../gitweb/gitweb.css\");\n-our \\$logo = \"file:///$(pwd)/../../gitweb/git-logo.png\";\n-our \\$favicon = \"file:///$(pwd)/../../gitweb/git-favicon.png\";\n+our @stylesheets = (\"file:///$safe_pwd/../../gitweb/gitweb.css\");\n+our \\$logo = \"file:///$safe_pwd/../../gitweb/git-logo.png\";\n+our \\$favicon = \"file:///$safe_pwd/../../gitweb/git-favicon.png\";\n our \\$projects_list = \"\";\n our \\$export_ok = \"\";\n our \\$strict_export = \"\";\n@@ -53,7 +54,7 @@ gitweb_run () {\n \t# written to web server logs, so we are not interested in that:\n \t# we are interested only in properly formatted errors/warnings\n \trm -f gitweb.log &&\n-\tperl -- $(pwd)/../../gitweb/gitweb.perl \\\n+\tperl -- \"$(pwd)/../../gitweb/gitweb.perl\" \\\n \t\t>/dev/null 2>gitweb.log &&\n \tif grep -q -s \"^[[]\" gitweb.log >/dev/null; then false; else true; fi\n \n-- \n1.5.5.1.128.g03a943\n"},{"id":"75981","messageId":"1209879480-16910-11-git-send-email-bdonlan@fushizen.net","threadId":"13032","inReplyTo":"1209879480-16910-10-git-send-email-bdonlan@fushizen.net","subject":"[PATCH v3 10/10] Rename the test trash directory to contain spaces.","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-05-04T05:38:00Z","receivedAt":"2008-05-04T05:38:00Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"In order to help prevent regressions in the future, rename the trash directory\nfor all tests to contain spaces. This patch also corrects two failures that\nwere caused or exposed by this change.\n\nSigned-off-by: Bryan Donlan <bdonlan@fushizen.net>\n---\n t/.gitignore                         |    2 +-\n t/t6200-fmt-merge-msg.sh             |    6 +++---\n t/t9121-git-svn-fetch-renamed-dir.sh |   12 ++++++------\n t/test-lib.sh                        |    4 ++--\n 4 files changed, 12 insertions(+), 12 deletions(-)\n\ndiff --git a/t/.gitignore b/t/.gitignore\nindex fad67c0..11ffd91 100644\n--- a/t/.gitignore\n+++ b/t/.gitignore\n@@ -1 +1 @@\n-trash\n+/trash directory\ndiff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh\nindex 526d7d1..9c0b926 100755\n--- a/t/t6200-fmt-merge-msg.sh\n+++ b/t/t6200-fmt-merge-msg.sh\n@@ -82,14 +82,14 @@ test_expect_success 'merge-msg test #1' '\n \tgit diff actual expected\n '\n \n-cat >expected <<\\EOF\n-Merge branch 'left' of ../trash\n+cat >expected <<EOF\n+Merge branch 'left' of ../$test\n EOF\n \n test_expect_success 'merge-msg test #2' '\n \n \tgit checkout master &&\n-\tgit fetch ../trash left &&\n+\tgit fetch ../\"$test\" left &&\n \n \tgit fmt-merge-msg <.git/FETCH_HEAD >actual &&\n \tgit diff actual expected\ndiff --git a/t/t9121-git-svn-fetch-renamed-dir.sh b/t/t9121-git-svn-fetch-renamed-dir.sh\nindex 5143ed6..99230b0 100755\n--- a/t/t9121-git-svn-fetch-renamed-dir.sh\n+++ b/t/t9121-git-svn-fetch-renamed-dir.sh\n@@ -7,14 +7,14 @@ test_description='git-svn can fetch renamed directories'\n \n . ./lib-git-svn.sh\n \n-test_expect_success 'load repository with renamed directory' \"\n-\tsvnadmin load -q $rawsvnrepo < ../t9121/renamed-dir.dump\n-\t\"\n+test_expect_success 'load repository with renamed directory' '\n+\tsvnadmin load -q \"$rawsvnrepo\" < ../t9121/renamed-dir.dump\n+\t'\n \n-test_expect_success 'init and fetch repository' \"\n-\tgit svn init $svnrepo/newname &&\n+test_expect_success 'init and fetch repository' '\n+\tgit svn init \"$svnrepo/newname\" &&\n \tgit svn fetch\n-\t\"\n+\t'\n \n test_done\n \ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 04e098b..5002fb0 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -411,14 +411,14 @@ fi\n . ../GIT-BUILD-OPTIONS\n \n # Test repository\n-test=trash\n+test=\"trash directory\"\n rm -fr \"$test\" || {\n \ttrap - exit\n \techo >&5 \"FATAL: Cannot prepare test area\"\n \texit 1\n }\n \n-test_create_repo $test\n+test_create_repo \"$test\"\n cd \"$test\"\n \n this_test=$(expr \"./$0\" : '.*/\\(t[0-9]*\\)-[^/]*$')\n-- \n1.5.5.1.128.g03a943\n"},{"id":"76078","messageId":"481EB155.6050501@viscovery.net","threadId":"13032","inReplyTo":"1209879480-16910-1-git-send-email-bdonlan@fushizen.net","subject":"Re: [PATCH v3 00/10] Fix git's test suite to pass when the path contains spaces","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-05-05T07:03:49Z","receivedAt":"2008-05-05T07:03:49Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Bryan Donlan schrieb:\n> This patch series fixes bugs in git and git's testsuite to allow all tests\n> to pass when the working directory contains whitespace and/or shell\n> metacharacters.\n\nThanks a lot, it's appreciated.\n\n> Bryan Donlan (10):\n>   git-rebase.sh: Fix --merge --abort failures when path contains\n>     whitespace\n>   config.c: Escape backslashes in section names properly\n>   git-send-email.perl: Handle shell metacharacters in $EDITOR properly\n>   test-lib.sh: Add a test_set_editor function to safely set $VISUAL\n>   Use test_set_editor in t9001-send-email.sh\n>   test-lib.sh: Fix some missing path quoting\n>   lib-git-svn.sh: Fix quoting issues with paths containing shell\n>     metacharacters\n>   Don't use the export NAME=value form in the test scripts.\n>   Fix tests breaking when checkout path contains shell metacharacters\n>   Rename the test trash directory to contain spaces.\n\nThe last patch breaks t9400-git-cvsserver-server.sh on my system:\n\n* expecting success: cat request-anonymous | git-cvsserver --strict-paths\npserver $SERVERDIR >log 2>&1 &&\n   sed -ne \\$p log | grep \"^I LOVE YOU$\"\n* FAIL 9: req_Root (strict paths)\n        cat request-anonymous | git-cvsserver --strict-paths pserver\n$SERVERDIR >log 2>&1 &&\n           sed -ne \\$p log | grep \"^I LOVE YOU$\"\n\nD-Quoting $SERVERDIR helps. ;)\n\nPlease post an incremental diff when you resend it. Feel free to add:\n\nTested-by: Johannes Sixt <johannes.sixt@telecom.at>\n\n-- Hannes\n"},{"id":"76079","messageId":"481EB168.1070206@viscovery.net","threadId":"13032","inReplyTo":"1209879480-16910-10-git-send-email-bdonlan@fushizen.net","subject":"Re: [PATCH v3 09/10] Fix tests breaking when checkout path contains shell metacharacters","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-05-05T07:04:08Z","receivedAt":"2008-05-05T07:04:08Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Bryan Donlan schrieb:\n> This fixes the remainder of the issues where the test script itself is at\n> fault for failing when the git checkout path contains whitespace or other\n> shell metacharacters.\n\nMaybe a note along these lines would be in order:\n\nThe majority of git svn tests used the idiom\n\n  test_expect_success \"title\" \"test script using $svnrepo\"\n\nThese were changed to have the test script in single-quotes:\n\n  test_expect_success \"title\" 'test script using \"$svnrepo\"'\n\n(which makes the patch so large). One consequence of this change is that\nin the verbose test output the value of $svnrepo (and in some cases other\nvariables, too) is no longer expanded, i.e. previously we saw\n\n  * expecting success:\n\ttest script using /path/to/git/t/trash/svnrepo\n\nbut now it is:\n\n  * expecting success:\n\ttest script using \"$svnrepo\"\n\n\n> \n> Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n\n>  test_expect_success 'push with insteadOf' '\n>  \tmk_empty &&\n> -\tTRASH=$(pwd)/ &&\n> -\tgit config url.$TRASH.insteadOf trash/ &&\n> +\tTRASH=\"$(pwd)/\" &&\n\nThis one would not be necessary, but I don't mind.\n\n> -test_expect_success 'make sure r2 still has old file' '\n> +test_expect_success 'make sure r2 still has old file' \"\n>  \tcd x &&\n> -\t\ttest -n \"$(git svn find-rev r1)\" &&\n> -\t\tgit reset --hard $(git svn find-rev r1) &&\n> +\t\ttest -n \\\"\\$(git svn find-rev r1)\\\" &&\n> +\t\tgit reset --hard \\$(git svn find-rev r1) &&\n>  \t\ttest -f README &&\n>  \t\ttest ! -f FOLLOWME &&\n> -\t\ttest x$(git svn find-rev r2) = x\n> -'\n> +\t\ttest x\\$(git svn find-rev r2) = x\n> +\"\n\nWhy did you change the quoting from sq to dq here?\n\n> diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\n> index 3dc261d..ae7082b 100755\n> --- a/t/t9500-gitweb-standalone-no-errors.sh\n> +++ b/t/t9500-gitweb-standalone-no-errors.sh\n> @@ -10,6 +10,7 @@ commandline, and checks that it would not write any errors\n>  or warnings to log.'\n>  \n>  gitweb_init () {\n> +\tsafe_pwd=\"$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')\"\n\nHow portable is this? (Just asking...)\n\n-- Hannes\n"},{"id":"76082","messageId":"20080505075759.GA20537@shion.is.fushizen.net","threadId":"13032","inReplyTo":"481EB168.1070206@viscovery.net","subject":"Re: [PATCH v3 09/10] Fix tests breaking when checkout path contains shell metacharacters","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-05-05T07:57:59Z","receivedAt":"2008-05-05T07:57:59Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"On Mon, May 05, 2008 at 09:04:08AM +0200, Johannes Sixt wrote:\n> Bryan Donlan schrieb:\n> > This fixes the remainder of the issues where the test script itself is at\n> > fault for failing when the git checkout path contains whitespace or other\n> > shell metacharacters.\n> \n> Maybe a note along these lines would be in order:\n> \n> The majority of git svn tests used the idiom\n> \n>   test_expect_success \"title\" \"test script using $svnrepo\"\n> \n> These were changed to have the test script in single-quotes:\n> \n>   test_expect_success \"title\" 'test script using \"$svnrepo\"'\n> \n> (which makes the patch so large). One consequence of this change is that\n> in the verbose test output the value of $svnrepo (and in some cases other\n> variables, too) is no longer expanded, i.e. previously we saw\n> \n>   * expecting success:\n> \ttest script using /path/to/git/t/trash/svnrepo\n> \n> but now it is:\n> \n>   * expecting success:\n> \ttest script using \"$svnrepo\"\n\nAh, good point. I don't see an easy way to make them show in expanded\nform without breaking space handling, unfortunately, but if a v4 is\nneeded I can toss that in.\n\n> \n> \n> > \n> > Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>\n> \n> >  test_expect_success 'push with insteadOf' '\n> >  \tmk_empty &&\n> > -\tTRASH=$(pwd)/ &&\n> > -\tgit config url.$TRASH.insteadOf trash/ &&\n> > +\tTRASH=\"$(pwd)/\" &&\n> \n> This one would not be necessary, but I don't mind.\n\nI wasn't sure what the rules were regarding non-copy-assignments, and\nwanted to play it safe (there was a conflict in this area when rebasing\ntoo).\n\n> > -test_expect_success 'make sure r2 still has old file' '\n> > +test_expect_success 'make sure r2 still has old file' \"\n> >  \tcd x &&\n> > -\t\ttest -n \"$(git svn find-rev r1)\" &&\n> > -\t\tgit reset --hard $(git svn find-rev r1) &&\n> > +\t\ttest -n \\\"\\$(git svn find-rev r1)\\\" &&\n> > +\t\tgit reset --hard \\$(git svn find-rev r1) &&\n> >  \t\ttest -f README &&\n> >  \t\ttest ! -f FOLLOWME &&\n> > -\t\ttest x$(git svn find-rev r2) = x\n> > -'\n> > +\t\ttest x\\$(git svn find-rev r2) = x\n> > +\"\n> \n> Why did you change the quoting from sq to dq here?\n\nErk, missed this in git add -i processing :) I'll drop this hunk.\n\n> > diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\n> > index 3dc261d..ae7082b 100755\n> > --- a/t/t9500-gitweb-standalone-no-errors.sh\n> > +++ b/t/t9500-gitweb-standalone-no-errors.sh\n> > @@ -10,6 +10,7 @@ commandline, and checks that it would not write any errors\n> >  or warnings to log.'\n> >  \n> >  gitweb_init () {\n> > +\tsafe_pwd=\"$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')\"\n> \n> How portable is this? (Just asking...)\n\nA grovel through perl-5.8.8's source indicates it has a fallback when\nthe platform does not have a real getcwd() function\n(util.c:Perl_getcwd_sv(), called from ext/POSIX/POSIX.xs)\n\n> \n> -- Hannes\n> \n> \n"},{"id":"76083","messageId":"20080505075940.GB20537@shion.is.fushizen.net","threadId":"13032","inReplyTo":"481EB155.6050501@viscovery.net","subject":"Re: [PATCH v3 00/10] Fix git's test suite to pass when the path contains spaces","fromName":"Bryan Donlan","fromEmail":"bdonlan@fushizen.net","sentAt":"2008-05-05T07:59:40Z","receivedAt":"2008-05-05T07:59:40Z","isPatch":true,"sender":{"key":"bdonlan@fushizen.net","avatar":null},"body":"On Mon, May 05, 2008 at 09:03:49AM +0200, Johannes Sixt wrote:\n> Bryan Donlan schrieb:\n> > This patch series fixes bugs in git and git's testsuite to allow all tests\n> > to pass when the working directory contains whitespace and/or shell\n> > metacharacters.\n> \n> Thanks a lot, it's appreciated.\n> \n> > Bryan Donlan (10):\n> >   git-rebase.sh: Fix --merge --abort failures when path contains\n> >     whitespace\n> >   config.c: Escape backslashes in section names properly\n> >   git-send-email.perl: Handle shell metacharacters in $EDITOR properly\n> >   test-lib.sh: Add a test_set_editor function to safely set $VISUAL\n> >   Use test_set_editor in t9001-send-email.sh\n> >   test-lib.sh: Fix some missing path quoting\n> >   lib-git-svn.sh: Fix quoting issues with paths containing shell\n> >     metacharacters\n> >   Don't use the export NAME=value form in the test scripts.\n> >   Fix tests breaking when checkout path contains shell metacharacters\n> >   Rename the test trash directory to contain spaces.\n> \n> The last patch breaks t9400-git-cvsserver-server.sh on my system:\n> \n> * expecting success: cat request-anonymous | git-cvsserver --strict-paths\n> pserver $SERVERDIR >log 2>&1 &&\n>    sed -ne \\$p log | grep \"^I LOVE YOU$\"\n> * FAIL 9: req_Root (strict paths)\n>         cat request-anonymous | git-cvsserver --strict-paths pserver\n> $SERVERDIR >log 2>&1 &&\n>            sed -ne \\$p log | grep \"^I LOVE YOU$\"\n> \n> D-Quoting $SERVERDIR helps. ;)\n\nHm, seems I don't have cvs installed :) Will fix.\n\n> \n> Please post an incremental diff when you resend it. Feel free to add:\n\nWhen you say post an incremental diff, do you mean send just an\nadditional patch to squash in, or re-send the series with an interdiff\nfrom the previous?\n\n> \n> Tested-by: Johannes Sixt <johannes.sixt@telecom.at>\n\nAnd does this go on a specific patch or the whole series?\n\n> \n> -- Hannes\n> \n> \n"},{"id":"76084","messageId":"481EC127.4070808@viscovery.net","threadId":"13032","inReplyTo":"20080505075759.GA20537@shion.is.fushizen.net","subject":"Re: [PATCH v3 09/10] Fix tests breaking when checkout path contains shell metacharacters","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-05-05T08:11:19Z","receivedAt":"2008-05-05T08:11:19Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Bryan Donlan schrieb:\n> On Mon, May 05, 2008 at 09:04:08AM +0200, Johannes Sixt wrote:\n>> Bryan Donlan schrieb:\n>>> This fixes the remainder of the issues where the test script itself is at\n>>> fault for failing when the git checkout path contains whitespace or other\n>>> shell metacharacters.\n>> Maybe a note along these lines would be in order:\n>>\n>> The majority of git svn tests used the idiom\n>>\n>>   test_expect_success \"title\" \"test script using $svnrepo\"\n>>\n>> These were changed to have the test script in single-quotes:\n>>\n>>   test_expect_success \"title\" 'test script using \"$svnrepo\"'\n>>\n>> (which makes the patch so large). One consequence of this change is that\n>> in the verbose test output the value of $svnrepo (and in some cases other\n>> variables, too) is no longer expanded, i.e. previously we saw\n>>\n>>   * expecting success:\n>> \ttest script using /path/to/git/t/trash/svnrepo\n>>\n>> but now it is:\n>>\n>>   * expecting success:\n>> \ttest script using \"$svnrepo\"\n> \n> Ah, good point. I don't see an easy way to make them show in expanded\n> form without breaking space handling, unfortunately, but if a v4 is\n> needed I can toss that in.\n\nI don't think there's a lot of value in the original behavior, so IMO you\ndon't have to resurrect it (it would make the test scripts less readable\nagain). Just mention the new behavior in the commit message so that\neverybody knows that the change is more or less intended.\n\n-- Hannes\n"},{"id":"76085","messageId":"481EC30B.4060401@viscovery.net","threadId":"13032","inReplyTo":"20080505075940.GB20537@shion.is.fushizen.net","subject":"Re: [PATCH v3 00/10] Fix git's test suite to pass when the path contains spaces","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-05-05T08:19:23Z","receivedAt":"2008-05-05T08:19:23Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Bryan Donlan schrieb:\n> On Mon, May 05, 2008 at 09:03:49AM +0200, Johannes Sixt wrote:\n>> Please post an incremental diff when you resend it. Feel free to add:\n> \n> When you say post an incremental diff, do you mean send just an\n> additional patch to squash in, or re-send the series with an interdiff\n> from the previous?\n\nThe latter. Since you'll most likely use rebase -i, this will amount to\njust 'git diff wst-submit3@{yesterday}..' or so.\n\n(This assumes that the rebased series originates from the same commit; if\nit doesn't because you have meanwhile updated your origin/master, you\nshould first rebase without any changes, then rebase -i again, and make\nchanges during this second rebase; then the interdiff is 'git diff\nwst-submit3@{1}..'.)\n\n>> Tested-by: Johannes Sixt <johannes.sixt@telecom.at>\n> \n> And does this go on a specific patch or the whole series?\n\nYou can add it to every patch below the SOB line.\n\n-- Hannes\n"},{"id":"76087","messageId":"481EC482.8060509@viscovery.net","threadId":"13032","inReplyTo":"1209879480-16910-11-git-send-email-bdonlan@fushizen.net","subject":"Re: [PATCH v3 10/10] Rename the test trash directory to contain spaces.","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-05-05T08:25:38Z","receivedAt":"2008-05-05T08:25:38Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Bryan Donlan schrieb:\n> In order to help prevent regressions in the future, rename the trash directory\n> for all tests to contain spaces. This patch also corrects two failures that\n> were caused or exposed by this change.\n\nOne more note: IMO, this patch should not contain fixes that the new\ndirectory name uncovers - those should be in 09/10. Here we really should\nonly rename the trash directory (plus the assorted $test changes).\n\n-- Hannes\n"}]}