t4014: let sed open its own files
In some cases, we were using a redirection operator to feed input into sed. However, since sed is capable of opening its own files, make sed open its own files instead of redirecting input into it. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Denton Liu committed
Aug 27, 2019 at 00:05 UTC
c6ec6dadba52a5186739fea4cf8fa2e26feb9e70
1 file changed
+14
-14
t/t4014-format-patch.sh
+14
-14
@@ -596,7 +596,7 @@ EOF
596
597
test_expect_success 'shortlog of cover-letter wraps overly-long onelines' '
598
git format-patch --cover-letter -2 &&
599
- sed -e "1,/A U Thor/d" -e "/^\$/q" <0000-cover-letter.patch >output &&
599
+ sed -e "1,/A U Thor/d" -e "/^\$/q" 0000-cover-letter.patch >output &&
600
test_cmp expect output
601
'
602
@@ -635,7 +635,7 @@ EOF
635
636
test_expect_success 'format-patch -p suppresses stat' '
637
git format-patch -p -2 &&
638
- sed -e "1,/^\$/d" -e "/^+5/q" <0001-This-is-an-excessively-long-subject-line-for-a-messa.patch >output &&
638
+ sed -e "1,/^\$/d" -e "/^+5/q" 0001-This-is-an-excessively-long-subject-line-for-a-messa.patch >output &&
639
test_cmp expect output
640
'
641
@@ -890,7 +890,7 @@ test_expect_success 'prepare mail-signature input' '
890
test_expect_success '--signature-file=file works' '
891
git format-patch --stdout --signature-file=mail-signature -1 >output &&
892
check_patch output &&
893
- sed -e "1,/^-- \$/d" <output >actual &&
893
+ sed -e "1,/^-- \$/d" output >actual &&
894
{
895
cat mail-signature && echo
896
} >expect &&
@@ -901,7 +901,7 @@ test_expect_success 'format.signaturefile works' '
901
test_config format.signaturefile mail-signature &&
902
git format-patch --stdout -1 >output &&
903
check_patch output &&
904
- sed -e "1,/^-- \$/d" <output >actual &&
904
+ sed -e "1,/^-- \$/d" output >actual &&
905
{
906
cat mail-signature && echo
907
} >expect &&
@@ -923,7 +923,7 @@ test_expect_success '--signature-file overrides format.signaturefile' '
923
git format-patch --stdout \
924
--signature-file=other-mail-signature -1 >output &&
925
check_patch output &&
926
- sed -e "1,/^-- \$/d" <output >actual &&
926
+ sed -e "1,/^-- \$/d" output >actual &&
927
{
928
cat other-mail-signature && echo
929
} >expect &&
@@ -992,7 +992,7 @@ test_expect_success 'format-patch wraps extremely long subject (ascii)' '
992
git add file &&
993
git commit -m "$M512" &&
994
git format-patch --stdout -1 >patch &&
995
- sed -n "/^Subject/p; /^ /p; /^$/q" <patch >subject &&
995
+ sed -n "/^Subject/p; /^ /p; /^$/q" patch >subject &&
996
test_cmp expect subject
997
'
998
@@ -1031,7 +1031,7 @@ test_expect_success 'format-patch wraps extremely long subject (rfc2047)' '
1031
git add file &&
1032
git commit -m "$M512" &&
1033
git format-patch --stdout -1 >patch &&
1034
- sed -n "/^Subject/p; /^ /p; /^$/q" <patch >subject &&
1034
+ sed -n "/^Subject/p; /^ /p; /^$/q" patch >subject &&
1035
test_cmp expect subject
1036
'
1037
@@ -1040,7 +1040,7 @@ check_author() {
1040
git add file &&
1041
GIT_AUTHOR_NAME=$1 git commit -m author-check &&
1042
git format-patch --stdout -1 >patch &&
1043
- sed -n "/^From: /p; /^ /p; /^$/q" <patch >actual &&
1043
+ sed -n "/^From: /p; /^ /p; /^$/q" patch >actual &&
1044
test_cmp expect actual
1045
}
1046
@@ -1160,7 +1160,7 @@ test_expect_success '--from=ident replaces author' '
1160
From: A U Thor <author@example.com>
1161
1162
EOF
1163
- sed -ne "/^From:/p; /^$/p; /^---$/q" <patch >patch.head &&
1163
+ sed -ne "/^From:/p; /^$/p; /^---$/q" patch >patch.head &&
1164
test_cmp expect patch.head
1165
'
1166
@@ -1172,7 +1172,7 @@ test_expect_success '--from uses committer ident' '
1172
From: A U Thor <author@example.com>
1173
1174
EOF
1175
- sed -ne "/^From:/p; /^$/p; /^---$/q" <patch >patch.head &&
1175
+ sed -ne "/^From:/p; /^$/p; /^---$/q" patch >patch.head &&
1176
test_cmp expect patch.head
1177
'
1178
@@ -1182,7 +1182,7 @@ test_expect_success '--from omits redundant in-body header' '
1182
From: A U Thor <author@example.com>
1183
1184
EOF
1185
- sed -ne "/^From:/p; /^$/p; /^---$/q" <patch >patch.head &&
1185
+ sed -ne "/^From:/p; /^$/p; /^---$/q" patch >patch.head &&
1186
test_cmp expect patch.head
1187
'
1188
@@ -1197,7 +1197,7 @@ test_expect_success 'in-body headers trigger content encoding' '
1197
From: éxötìc <author@example.com>
1198
1199
EOF
1200
- sed -ne "/^From:/p; /^$/p; /^Content-Type/p; /^---$/q" <patch >patch.head &&
1200
+ sed -ne "/^From:/p; /^$/p; /^Content-Type/p; /^---$/q" patch >patch.head &&
1201
test_cmp expect patch.head
1202
'
1203
@@ -1788,7 +1788,7 @@ test_expect_success 'interdiff: cover-letter' '
1788
git format-patch --cover-letter --interdiff=boop~2 -1 boop &&
1789
test_i18ngrep "^Interdiff:$" 0000-cover-letter.patch &&
1790
test_i18ngrep ! "^Interdiff:$" 0001-fleep.patch &&
1791
- sed "1,/^@@ /d; /^-- $/q" <0000-cover-letter.patch >actual &&
1791
+ sed "1,/^@@ /d; /^-- $/q" 0000-cover-letter.patch >actual &&
1792
test_cmp expect actual
1793
'
1794
@@ -1804,7 +1804,7 @@ test_expect_success 'interdiff: solo-patch' '
1804
EOF
1805
git format-patch --interdiff=boop~2 -1 boop &&
1806
test_i18ngrep "^Interdiff:$" 0001-fleep.patch &&
1807
- sed "1,/^ @@ /d; /^$/q" <0001-fleep.patch >actual &&
1807
+ sed "1,/^ @@ /d; /^$/q" 0001-fleep.patch >actual &&
1808
test_cmp expect actual
1809
'
1810