t/t0*: avoid redundant uses of cat
Signed-off-by: Beat Bolli <dev+git@drbeat.li> Acked-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Beat Bolli committed
Mar 15, 2024 at 20:46 UTC
74615c2a748ad51c8a04e5f06a427497b93a0dcd
4 files changed
+5
-5
t/t0002-gitfile.sh
+1
-1
@@ -40,7 +40,7 @@ test_expect_success 'final setup + check rev-parse --git-dir' '
40
41
test_expect_success 'check hash-object' '
42
echo "foo" >bar &&
43
- SHA=$(cat bar | git hash-object -w --stdin) &&
43
+ SHA=$(git hash-object -w --stdin <bar) &&
44
test_path_is_file "$REAL/objects/$(objpath $SHA)"
45
'
46
t/t0011-hashmap.sh
+1
-1
@@ -239,7 +239,7 @@ test_expect_success 'grow / shrink' '
239
echo value40 >> expect &&
240
echo size >> in &&
241
echo 64 39 >> expect &&
242
- cat in | test-tool hashmap > out &&
242
+ test-tool hashmap <in >out &&
243
test_cmp expect out
244
245
'
t/t0028-working-tree-encoding.sh
+2
-2
@@ -131,8 +131,8 @@ do
131
test_when_finished "rm -f crlf.utf${i}.raw lf.utf${i}.raw" &&
132
test_when_finished "git reset --hard HEAD^" &&
133
134
- cat lf.utf8.raw | write_utf${i} >lf.utf${i}.raw &&
135
- cat crlf.utf8.raw | write_utf${i} >crlf.utf${i}.raw &&
134
+ write_utf${i} <lf.utf8.raw >lf.utf${i}.raw &&
135
+ write_utf${i} <crlf.utf8.raw >crlf.utf${i}.raw &&
136
cp crlf.utf${i}.raw eol.utf${i} &&
137
138
cat >expectIndexLF <<-EOF &&
t/t0204-gettext-reencode-sanity.sh
+1
-1
@@ -82,7 +82,7 @@ test_expect_success GETTEXT_ISO_LOCALE 'gettext.c: git init UTF-8 -> ISO-8859-1'
82
printf "Bjó til tóma Git lind" >expect &&
83
LANGUAGE=is LC_ALL="$is_IS_iso_locale" git init repo >actual &&
84
test_when_finished "rm -rf repo" &&
85
- grep "^$(cat expect | iconv -f UTF-8 -t ISO8859-1) " actual
85
+ grep "^$(iconv -f UTF-8 -t ISO8859-1 <expect) " actual
86
'
87
88
test_done