[PATCH v2 10/10] Rename the test trash directory to contain shell metacharacters.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git@...>
Cc: Johannes Sixt <j.sixt@...>, Adam Roben <aroben@...>, <gitster@...>, Bryan Donlan <bdonlan@...>
Date: Thursday, April 10, 2008 - 2:50 am

In order to help prevent regressions in the future, rename the trash directory
for all tests to contain an assortment of shell metacharacters. This patch
also corrects two failures that were caused or exposed by this change.

Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
---
 t/.gitignore                         |    2 +-
 t/t6200-fmt-merge-msg.sh             |    6 +++---
 t/t9121-git-svn-fetch-renamed-dir.sh |   12 ++++++------
 t/test-lib.sh                        |    4 ++--
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/t/.gitignore b/t/.gitignore
index fad67c0..fd07343 100644
--- a/t/.gitignore
+++ b/t/.gitignore
@@ -1 +1 @@
-trash
+/trash directory with characters like $ and " and ' in its name
diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
index 526d7d1..9c0b926 100755
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
@@ -82,14 +82,14 @@ test_expect_success 'merge-msg test #1' '
 	git diff actual expected
 '
 
-cat >expected <<\EOF
-Merge branch 'left' of ../trash
+cat >expected <<EOF
+Merge branch 'left' of ../$test
 EOF
 
 test_expect_success 'merge-msg test #2' '
 
 	git checkout master &&
-	git fetch ../trash left &&
+	git fetch ../"$test" left &&
 
 	git fmt-merge-msg <.git/FETCH_HEAD >actual &&
 	git diff actual expected
diff --git a/t/t9121-git-svn-fetch-renamed-dir.sh b/t/t9121-git-svn-fetch-renamed-dir.sh
index 5143ed6..99230b0 100755
--- a/t/t9121-git-svn-fetch-renamed-dir.sh
+++ b/t/t9121-git-svn-fetch-renamed-dir.sh
@@ -7,14 +7,14 @@ test_description='git-svn can fetch renamed directories'
 
 . ./lib-git-svn.sh
 
-test_expect_success 'load repository with renamed directory' "
-	svnadmin load -q $rawsvnrepo < ../t9121/renamed-dir.dump
-	"
+test_expect_success 'load repository with renamed directory' '
+	svnadmin load -q "$rawsvnrepo" < ../t9121/renamed-dir.dump
+	'
 
-test_expect_success 'init and fetch repository' "
-	git svn init $svnrepo/newname &&
+test_expect_success 'init and fetch repository' '
+	git svn init "$svnrepo/newname" &&
 	git svn fetch
-	"
+	'
 
 test_done
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 04e098b..f6b2954 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -411,14 +411,14 @@ fi
 . ../GIT-BUILD-OPTIONS
 
 # Test repository
-test=trash
+test="trash directory with characters like \$ and \" and ' in its name"
 rm -fr "$test" || {
 	trap - exit
 	echo >&5 "FATAL: Cannot prepare test area"
 	exit 1
 }
 
-test_create_repo $test
+test_create_repo "$test"
 cd "$test"
 
 this_test=$(expr "./$0" : '.*/\(t[0-9]*\)-[^/]*$')
-- 
1.5.5.33.gc0a39.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v2 10/10] Rename the test trash directory to contain ..., Bryan Donlan, (Thu Apr 10, 2:50 am)
[PATCH 4/8] test-lib.sh: Fix some missing path quoting, Bryan Donlan, (Tue Apr 8, 9:30 pm)
[PATCH 7/8] Use test_set_editor in t9001-send-email.sh, Bryan Donlan, (Tue Apr 8, 9:30 pm)