summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Gernhardt <benji@silverinsanity.com>2008-10-31 05:09:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-11-01 04:38:48 (GMT)
commit6ecfd91df5ec462aeded967c9ad21912c249f96e (patch)
treefaa7135734d9905f6cb430abe9561b5f771c0250
parentdf5e91fc2c95e051744ec9b9de66869d2b323037 (diff)
downloadgit-6ecfd91df5ec462aeded967c9ad21912c249f96e.zip
git-6ecfd91df5ec462aeded967c9ad21912c249f96e.tar.gz
git-6ecfd91df5ec462aeded967c9ad21912c249f96e.tar.bz2
Avoid using non-portable `echo -n` in tests.
Expecting echo to recognise -n is a BSDism. Using printf is far more portable. Discovered on OS X 10.5.5 in t4030-diff-textconv.sh and changed in all the test scripts. Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t2005-checkout-index-symlinks.sh2
-rwxr-xr-xt/t2102-update-index-symlinks.sh4
-rwxr-xr-xt/t4030-diff-textconv.sh2
-rwxr-xr-xt/t6025-merge-symlinks.sh4
-rwxr-xr-xt/t9400-git-cvsserver-server.sh2
5 files changed, 7 insertions, 7 deletions
diff --git a/t/t2005-checkout-index-symlinks.sh b/t/t2005-checkout-index-symlinks.sh
index ed12c4d..9fa5610 100755
--- a/t/t2005-checkout-index-symlinks.sh
+++ b/t/t2005-checkout-index-symlinks.sh
@@ -13,7 +13,7 @@ file if core.symlinks is false.'
test_expect_success \
'preparation' '
git config core.symlinks false &&
-l=$(echo -n file | git hash-object -t blob -w --stdin) &&
+l=$(printf file | git hash-object -t blob -w --stdin) &&
echo "120000 $l symlink" | git update-index --index-info'
test_expect_success \
diff --git a/t/t2102-update-index-symlinks.sh b/t/t2102-update-index-symlinks.sh
index f195aef..1ed44ee 100755
--- a/t/t2102-update-index-symlinks.sh
+++ b/t/t2102-update-index-symlinks.sh
@@ -13,12 +13,12 @@ even if a plain file is in the working tree if core.symlinks is false.'
test_expect_success \
'preparation' '
git config core.symlinks false &&
-l=$(echo -n file | git hash-object -t blob -w --stdin) &&
+l=$(printf file | git hash-object -t blob -w --stdin) &&
echo "120000 $l symlink" | git update-index --index-info'
test_expect_success \
'modify the symbolic link' '
-echo -n new-file > symlink &&
+printf new-file > symlink &&
git update-index symlink'
test_expect_success \
diff --git a/t/t4030-diff-textconv.sh b/t/t4030-diff-textconv.sh
index 1b09648..3aed1bb 100755
--- a/t/t4030-diff-textconv.sh
+++ b/t/t4030-diff-textconv.sh
@@ -105,7 +105,7 @@ index ad8b3d2..67be421
EOF
# make a symlink the hard way that works on symlink-challenged file systems
test_expect_failure 'textconv does not act on symlinks' '
- echo -n frotz > file &&
+ printf frotz > file &&
git add file &&
git ls-files -s | sed -e s/100644/120000/ |
git update-index --index-info &&
diff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh
index 53892a5..433c4de 100755
--- a/t/t6025-merge-symlinks.sh
+++ b/t/t6025-merge-symlinks.sh
@@ -18,11 +18,11 @@ git add file &&
git commit -m initial &&
git branch b-symlink &&
git branch b-file &&
-l=$(echo -n file | git hash-object -t blob -w --stdin) &&
+l=$(printf file | git hash-object -t blob -w --stdin) &&
echo "120000 $l symlink" | git update-index --index-info &&
git commit -m master &&
git checkout b-symlink &&
-l=$(echo -n file-different | git hash-object -t blob -w --stdin) &&
+l=$(printf file-different | git hash-object -t blob -w --stdin) &&
echo "120000 $l symlink" | git update-index --index-info &&
git commit -m b-symlink &&
git checkout b-file &&
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index c1850d2..6a37f71 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -424,7 +424,7 @@ cd "$WORKDIR"
test_expect_success 'cvs update (-p)' '
touch really-empty &&
echo Line 1 > no-lf &&
- echo -n Line 2 >> no-lf &&
+ printf "Line 2" >> no-lf &&
git add really-empty no-lf &&
git commit -q -m "Update -p test" &&
git push gitcvs.git >/dev/null &&