Skip to content

Commit 27f6342

Browse files
committed
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" <[email protected]>\$" patch5 was looking for "^ *S." in these three files: "E." "Cipient <[email protected]>$" "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 <[email protected]>
1 parent 2060ed5 commit 27f6342

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t4014-format-patch.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ test_expect_failure 'additional command line cc (rfc822)' '
155155
git config --replace-all format.headers "Cc: R E Cipient <[email protected]>" &&
156156
git format-patch --cc="S. E. Cipient <[email protected]>" --stdout master..side | sed -e "/^\$/q" >patch5 &&
157157
grep "^Cc: R E Cipient <[email protected]>,\$" patch5 &&
158-
grep "^ *"S. E. Cipient" <[email protected]>\$" patch5
158+
grep "^ *\"S. E. Cipient\" <[email protected]>\$" patch5
159159
'
160160

161161
test_expect_success 'command line headers' '
@@ -183,7 +183,7 @@ test_expect_success 'command line To: header (ascii)' '
183183
test_expect_failure 'command line To: header (rfc822)' '
184184
185185
git format-patch --to="R. E. Cipient <[email protected]>" --stdout master..side | sed -e "/^\$/q" >patch8 &&
186-
grep "^To: "R. E. Cipient" <[email protected]>\$" patch8
186+
grep "^To: \"R. E. Cipient\" <[email protected]>\$" patch8
187187
'
188188

189189
test_expect_failure 'command line To: header (rfc2047)' '
@@ -203,7 +203,7 @@ test_expect_failure 'configuration To: header (rfc822)' '
203203
204204
git config format.to "R. E. Cipient <[email protected]>" &&
205205
git format-patch --stdout master..side | sed -e "/^\$/q" >patch9 &&
206-
grep "^To: "R. E. Cipient" <[email protected]>\$" patch9
206+
grep "^To: \"R. E. Cipient\" <[email protected]>\$" patch9
207207
'
208208

209209
test_expect_failure 'configuration To: header (rfc2047)' '

0 commit comments

Comments
 (0)