]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Suppress some bash redirection error messages
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>
Tue, 26 Aug 2008 17:52:57 +0000 (18:52 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Aug 2008 23:25:30 +0000 (16:25 -0700)
In particular, when testing if the filesystem allows tabs in
filenames, bash issues an error something like:

./t4016-diff-quote.sh: pathname with HT: No such file or directory

which is caused by the failure of the (stdout) redirection,
since the file cannot be created. In order to suppress the
error message, you must redirect stderr to /dev/null, *before*
the stdout redirection on the command-line.

Also, remove a redundant filesystem check from the begining of
the t3902-quoted.sh test and standardise the "test skipped"
message to 'say' on exit.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3300-funny-names.sh
t/t3902-quoted.sh
t/t4016-diff-quote.sh

index 0574ef1f101df172a30755726b0ea1b6c2ef5f7d..db46d53e8271c0410a0dbf53a3560a8b635e2853 100755 (executable)
@@ -21,7 +21,7 @@ cat >"$p0" <<\EOF
 3. A quick brown fox jumps over the lazy cat, oops dog.
 EOF
 
-cat >"$p1" "$p0"
+cat 2>/dev/null >"$p1" "$p0"
 echo 'Foo Bar Baz' >"$p2"
 
 test -f "$p1" && cmp "$p0" "$p1" || {
index fe4fb5116ac4c482c357f0af3f0a34da27cee237..58680524258037eb0c17f7e2929d58ed1c16b574 100755 (executable)
@@ -7,12 +7,6 @@ test_description='quoted output'
 
 . ./test-lib.sh
 
-P1='pathname   with HT'
-: >"$P1" 2>&1 && test -f "$P1" && rm -f "$P1" || {
-       echo >&2 'Filesystem does not support HT in names'
-       test_done
-}
-
 FN='濱野'
 GN='純'
 HT='   '
@@ -20,7 +14,7 @@ LF='
 '
 DQ='"'
 
-echo foo > "Name and an${HT}HT"
+echo foo 2>/dev/null > "Name and an${HT}HT"
 test -f "Name and an${HT}HT" || {
        # since FAT/NTFS does not allow tabs in filenames, skip this test
        say 'Your filesystem does not allow tabs in filenames, test skipped.'
index f07035ab7ec72557be7a0cba9ea286bcbaa79da9..55eb5f83f17c0ebfb537d390fd3913b7c89d65f4 100755 (executable)
@@ -13,8 +13,8 @@ P1='pathname  with HT'
 P2='pathname with SP'
 P3='pathname
 with LF'
-: >"$P1" 2>&1 && test -f "$P1" && rm -f "$P1" || {
-       echo >&2 'Filesystem does not support tabs in names'
+: 2>/dev/null >"$P1" && test -f "$P1" && rm -f "$P1" || {
+       say 'Your filesystem does not allow tabs in filenames, test skipped.'
        test_done
 }