summaryrefslogtreecommitdiff
path: root/t/t7810-grep.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-06-20 14:49:34 -0700
committerJunio C Hamano <gitster@pobox.com>2011-06-20 14:49:34 -0700
commit93d5e0c2087916941934b1e55c979c52f5af3f20 (patch)
tree670a9ca59674b3e7b3eb1adcf9c51a8909b00ff1 /t/t7810-grep.sh
parentd0042abe14b3aece87595d365d6eba84c3e53327 (diff)
downloadgit-93d5e0c2087916941934b1e55c979c52f5af3f20.tar.gz
t7810: avoid unportable use of "echo"
Michael J Gruber noticed that under /bin/dash this test failed (as is expected -- \n in the string can be interpreted by the command), while it passed with bash. We probably could work it around by using backquote in front of it, but it is safer and more readable to avoid "echo" altogether in a case like this. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7810-grep.sh')
-rwxr-xr-xt/t7810-grep.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 69bd576d1c..6379ad60bc 100755
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
@@ -658,9 +658,9 @@ test_expect_success LIBPCRE 'grep -P -v pattern' '
'
test_expect_success LIBPCRE 'grep -P -i pattern' '
- {
- echo "hello.c: printf(\"Hello world.\n\");"
- } >expected &&
+ cat >expected <<-EOF &&
+ hello.c: printf("Hello world.\n");
+ EOF
git grep -P -i "PRINTF\([^\d]+\)" hello.c >actual &&
test_cmp expected actual
'