From 7b90363099e55835885052e7c0512d2af7fdc035 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 18 Dec 2012 22:44:56 -0800 Subject: t0200: "locale" may not exist On systems without "locale" installed, t0200-gettext-basic.sh leaked error messages when checking if some test locales are available. Hide them, as they are not very useful. Signed-off-by: Junio C Hamano --- t/lib-gettext.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/lib-gettext.sh b/t/lib-gettext.sh index 0f76f6cdc..ae8883a07 100644 --- a/t/lib-gettext.sh +++ b/t/lib-gettext.sh @@ -14,12 +14,14 @@ export GIT_TEXTDOMAINDIR GIT_PO_PATH if test_have_prereq GETTEXT && ! test_have_prereq GETTEXT_POISON then # is_IS.UTF-8 on Solaris and FreeBSD, is_IS.utf8 on Debian - is_IS_locale=$(locale -a | sed -n '/^is_IS\.[uU][tT][fF]-*8$/{ + is_IS_locale=$(locale -a 2>/dev/null | + sed -n '/^is_IS\.[uU][tT][fF]-*8$/{ p q }') # is_IS.ISO8859-1 on Solaris and FreeBSD, is_IS.iso88591 on Debian - is_IS_iso_locale=$(locale -a | sed -n '/^is_IS\.[iI][sS][oO]8859-*1$/{ + is_IS_iso_locale=$(locale -a 2>/dev/null | + sed -n '/^is_IS\.[iI][sS][oO]8859-*1$/{ p q }') -- cgit v1.2.1 From 2060ed50e76bfc89e2421cffbb56694e9d803593 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 18 Dec 2012 20:57:13 -0800 Subject: t9502: do not assume GNU tar The check_snapshot function makes sure that no cruft outside the repository hierarchy is added to the tar archive. The output from "tar tf" on the resulting archive is inspected to see if there is anything that does not begin with "$prefix/". There are two issues with this implementation: - Traditional tar implemenations that do not understand pax_global_header will write it out as if it is a plain file at the top-level; - Some implementations of tar do not add trailing slash when showing a directory entry (i.e. the output line for the entire archive will show "$prefix", not "$prefix/"). Fix them so that what we want to validate can be tested with traditional tar implementations. Signed-off-by: Junio C Hamano --- t/t9502-gitweb-standalone-parse-output.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t9502-gitweb-standalone-parse-output.sh b/t/t9502-gitweb-standalone-parse-output.sh index 3a8e7d3f5..86dfee2e4 100755 --- a/t/t9502-gitweb-standalone-parse-output.sh +++ b/t/t9502-gitweb-standalone-parse-output.sh @@ -40,7 +40,7 @@ check_snapshot () { echo "basename=$basename" grep "filename=.*$basename.tar" gitweb.headers >/dev/null 2>&1 && "$TAR" tf gitweb.body >file_list && - ! grep -v "^$prefix/" file_list + ! grep -v -e "^$prefix$" -e "^$prefix/" -e "^pax_global_header$" file_list } test_expect_success setup ' -- cgit v1.2.1 From 27f6342f615a4e3fc4dcab5cef2b6bc9ca574ce6 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 18 Dec 2012 19:13:30 -0800 Subject: t4014: fix arguments to grep These "expect-failure" tests were not looking for the right string in the patch file. For example: grep "^ *"S. E. Cipient" \$" patch5 was looking for "^ *S." in these three files: "E." "Cipient $" "patch5" With some implementations of grep, the lack of file "E." was reported as an error, leading to the failure of the test. With other implementations of grep, the pattern "^ *S." matched what was in patch5, without diagnosing the missing files as an error, and made these tests unexpectedly pass. Signed-off-by: Junio C Hamano --- t/t4014-format-patch.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index ad9f69e60..e47efc37d 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -155,7 +155,7 @@ test_expect_failure 'additional command line cc (rfc822)' ' git config --replace-all format.headers "Cc: R E Cipient " && git format-patch --cc="S. E. Cipient " --stdout master..side | sed -e "/^\$/q" >patch5 && grep "^Cc: R E Cipient ,\$" patch5 && - grep "^ *"S. E. Cipient" \$" patch5 + grep "^ *\"S. E. Cipient\" \$" patch5 ' test_expect_success 'command line headers' ' @@ -183,7 +183,7 @@ test_expect_success 'command line To: header (ascii)' ' test_expect_failure 'command line To: header (rfc822)' ' git format-patch --to="R. E. Cipient " --stdout master..side | sed -e "/^\$/q" >patch8 && - grep "^To: "R. E. Cipient" \$" patch8 + grep "^To: \"R. E. Cipient\" \$" patch8 ' test_expect_failure 'command line To: header (rfc2047)' ' @@ -203,7 +203,7 @@ test_expect_failure 'configuration To: header (rfc822)' ' git config format.to "R. E. Cipient " && git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 && - grep "^To: "R. E. Cipient" \$" patch9 + grep "^To: \"R. E. Cipient\" \$" patch9 ' test_expect_failure 'configuration To: header (rfc2047)' ' -- cgit v1.2.1