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" <scipient@example.com>\$" patch5 was looking for "^ *S." in these three files: "E." "Cipient <scipient@example.com>$" "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 <gitster@pobox.com>

Junio C Hamano committed Dec 18, 2012 at 19:13 UTC 27f6342f615a4e3fc4dcab5cef2b6bc9ca574ce6
1 file changed +3 -3
t/t4014-format-patch.sh
+3 -3
@@ -155,7 +155,7 @@ test_expect_failure 'additional command line cc (rfc822)' '
155 git config --replace-all format.headers "Cc: R E Cipient <rcipient@example.com>" &&
156 git format-patch --cc="S. E. Cipient <scipient@example.com>" --stdout master..side | sed -e "/^\$/q" >patch5 &&
157 grep "^Cc: R E Cipient <rcipient@example.com>,\$" patch5 &&
158 - grep "^ *"S. E. Cipient" <scipient@example.com>\$" patch5
158 + grep "^ *\"S. E. Cipient\" <scipient@example.com>\$" patch5
159 '
160
161 test_expect_success 'command line headers' '
@@ -183,7 +183,7 @@ test_expect_success 'command line To: header (ascii)' '
183 test_expect_failure 'command line To: header (rfc822)' '
184
185 git format-patch --to="R. E. Cipient <rcipient@example.com>" --stdout master..side | sed -e "/^\$/q" >patch8 &&
186 - grep "^To: "R. E. Cipient" <rcipient@example.com>\$" patch8
186 + grep "^To: \"R. E. Cipient\" <rcipient@example.com>\$" patch8
187 '
188
189 test_expect_failure 'command line To: header (rfc2047)' '
@@ -203,7 +203,7 @@ test_expect_failure 'configuration To: header (rfc822)' '
203
204 git config format.to "R. E. Cipient <rcipient@example.com>" &&
205 git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 &&
206 - grep "^To: "R. E. Cipient" <rcipient@example.com>\$" patch9
206 + grep "^To: \"R. E. Cipient\" <rcipient@example.com>\$" patch9
207 '
208
209 test_expect_failure 'configuration To: header (rfc2047)' '