@matheusbsbs / matheus-bagliano / commits / 6ecfd91df5
Fork 0

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>

Brian Gernhardt committed Oct 31, 2008 at 01:09 UTC 6ecfd91df5ec462aeded967c9ad21912c249f96e
5 files changed +7 -7
t/t2005-checkout-index-symlinks.sh
+1 -1
@@ -13,7 +13,7 @@ file if core.symlinks is false.'
13 test_expect_success \
14 'preparation' '
15 git config core.symlinks false &&
16 -l=$(echo -n file | git hash-object -t blob -w --stdin) &&
16 +l=$(printf file | git hash-object -t blob -w --stdin) &&
17 echo "120000 $l symlink" | git update-index --index-info'
18
19 test_expect_success \
t/t2102-update-index-symlinks.sh
+2 -2
@@ -13,12 +13,12 @@ even if a plain file is in the working tree if core.symlinks is false.'
13 test_expect_success \
14 'preparation' '
15 git config core.symlinks false &&
16 -l=$(echo -n file | git hash-object -t blob -w --stdin) &&
16 +l=$(printf file | git hash-object -t blob -w --stdin) &&
17 echo "120000 $l symlink" | git update-index --index-info'
18
19 test_expect_success \
20 'modify the symbolic link' '
21 -echo -n new-file > symlink &&
21 +printf new-file > symlink &&
22 git update-index symlink'
23
24 test_expect_success \
t/t4030-diff-textconv.sh
+1 -1
@@ -105,7 +105,7 @@ index ad8b3d2..67be421
105 EOF
106 # make a symlink the hard way that works on symlink-challenged file systems
107 test_expect_failure 'textconv does not act on symlinks' '
108 - echo -n frotz > file &&
108 + printf frotz > file &&
109 git add file &&
110 git ls-files -s | sed -e s/100644/120000/ |
111 git update-index --index-info &&
t/t6025-merge-symlinks.sh
+2 -2
@@ -18,11 +18,11 @@ git add file &&
18 git commit -m initial &&
19 git branch b-symlink &&
20 git branch b-file &&
21 -l=$(echo -n file | git hash-object -t blob -w --stdin) &&
21 +l=$(printf file | git hash-object -t blob -w --stdin) &&
22 echo "120000 $l symlink" | git update-index --index-info &&
23 git commit -m master &&
24 git checkout b-symlink &&
25 -l=$(echo -n file-different | git hash-object -t blob -w --stdin) &&
25 +l=$(printf file-different | git hash-object -t blob -w --stdin) &&
26 echo "120000 $l symlink" | git update-index --index-info &&
27 git commit -m b-symlink &&
28 git checkout b-file &&
t/t9400-git-cvsserver-server.sh
+1 -1
@@ -424,7 +424,7 @@ cd "$WORKDIR"
424 test_expect_success 'cvs update (-p)' '
425 touch really-empty &&
426 echo Line 1 > no-lf &&
427 - echo -n Line 2 >> no-lf &&
427 + printf "Line 2" >> no-lf &&
428 git add really-empty no-lf &&
429 git commit -q -m "Update -p test" &&
430 git push gitcvs.git >/dev/null &&