diff options
author | Bryan Donlan <bdonlan@fushizen.net> | 2008-05-04 01:37:59 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-05-05 14:37:02 -0700 |
commit | f69e836fab2b634281d92a0d304de4d768e479cc (patch) | |
tree | ebd3e28ff26f0077846085d5c86970cc5ee05759 /t/t1020-subdirectory.sh | |
parent | Don't use the 'export NAME=value' in the test scripts. (diff) | |
download | tgif-f69e836fab2b634281d92a0d304de4d768e479cc.tar.xz |
Fix tests breaking when checkout path contains shell metacharacters
This fixes the remainder of the issues where the test script itself is at
fault for failing when the git checkout path contains whitespace or other
shell metacharacters.
The majority of git svn tests used the idiom
test_expect_success "title" "test script using $svnrepo"
These were changed to have the test script in single-quotes:
test_expect_success "title" 'test script using "$svnrepo"'
which unfortunately makes the patch appear larger than it really is.
One consequence of this change is that in the verbose test output the
value of $svnrepo (and in some cases other variables, too) is no
longer expanded, i.e. previously we saw
* expecting success:
test script using /path/to/git/t/trash/svnrepo
but now it is:
* expecting success:
test script using "$svnrepo"
Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1020-subdirectory.sh')
-rwxr-xr-x | t/t1020-subdirectory.sh | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh index b9cef3422c..fc386ba033 100755 --- a/t/t1020-subdirectory.sh +++ b/t/t1020-subdirectory.sh @@ -21,7 +21,7 @@ LF=' ' test_expect_success 'update-index and ls-files' ' - cd $HERE && + cd "$HERE" && git update-index --add one && case "`git ls-files`" in one) echo ok one ;; @@ -41,7 +41,7 @@ test_expect_success 'update-index and ls-files' ' ' test_expect_success 'cat-file' ' - cd $HERE && + cd "$HERE" && two=`git ls-files -s dir/two` && two=`expr "$two" : "[0-7]* \\([0-9a-f]*\\)"` && echo "$two" && @@ -54,7 +54,7 @@ test_expect_success 'cat-file' ' rm -f actual dir/actual test_expect_success 'diff-files' ' - cd $HERE && + cd "$HERE" && echo a >>one && echo d >>dir/two && case "`git diff-files --name-only`" in @@ -74,7 +74,7 @@ test_expect_success 'diff-files' ' ' test_expect_success 'write-tree' ' - cd $HERE && + cd "$HERE" && top=`git write-tree` && echo $top && cd dir && @@ -84,7 +84,7 @@ test_expect_success 'write-tree' ' ' test_expect_success 'checkout-index' ' - cd $HERE && + cd "$HERE" && git checkout-index -f -u one && cmp one original.one && cd dir && @@ -93,7 +93,7 @@ test_expect_success 'checkout-index' ' ' test_expect_success 'read-tree' ' - cd $HERE && + cd "$HERE" && rm -f one dir/two && tree=`git write-tree` && git read-tree --reset -u "$tree" && @@ -107,27 +107,27 @@ test_expect_success 'read-tree' ' ' test_expect_success 'no file/rev ambiguity check inside .git' ' - cd $HERE && + cd "$HERE" && git commit -a -m 1 && - cd $HERE/.git && + cd "$HERE"/.git && git show -s HEAD ' test_expect_success 'no file/rev ambiguity check inside a bare repo' ' - cd $HERE && + cd "$HERE" && git clone -s --bare .git foo.git && cd foo.git && GIT_DIR=. git show -s HEAD ' # This still does not work as it should... : test_expect_success 'no file/rev ambiguity check inside a bare repo' ' - cd $HERE && + cd "$HERE" && git clone -s --bare .git foo.git && cd foo.git && git show -s HEAD ' test_expect_success 'detection should not be fooled by a symlink' ' - cd $HERE && + cd "$HERE" && rm -fr foo.git && git clone -s .git another && ln -s another yetanother && |