Skip to content

Commit 237ce76

Browse files
Beat Bolligitster
authored andcommitted
t/t4*: avoid redundant uses of cat
Signed-off-by: Beat Bolli <[email protected]> Acked-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2b5a303 commit 237ce76

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

t/t4020-diff-external.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ keep_only_cr () {
232232
test_expect_success 'external diff with autocrlf = true' '
233233
test_config core.autocrlf true &&
234234
GIT_EXTERNAL_DIFF=./fake-diff.sh git diff &&
235-
test $(wc -l < crlfed.txt) = $(cat crlfed.txt | keep_only_cr | wc -c)
235+
test $(wc -l <crlfed.txt) = $(keep_only_cr <crlfed.txt | wc -c)
236236
'
237237

238238
test_expect_success 'diff --cached' '

t/t4205-log-pretty-formats.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ test_expect_success 'NUL termination with --reflog --pretty=oneline' '
156156
for r in $revs
157157
do
158158
git show -s --pretty=oneline "$r" >raw &&
159-
cat raw | lf_to_nul || return 1
159+
lf_to_nul <raw || return 1
160160
done >expect &&
161161
# the trailing NUL is already produced so we do not need to
162162
# output another one

t/t4301-merge-tree-write-tree.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ test_expect_success 'rename/add handling' '
313313
# First, check that the bar that appears at stage 3 does not
314314
# correspond to an individual blob anywhere in history
315315
#
316-
hash=$(cat out | tr "\0" "\n" | head -n 3 | grep 3.bar | cut -f 2 -d " ") &&
316+
hash=$(tr "\0" "\n" <out | head -n 3 | grep 3.bar | cut -f 2 -d " ") &&
317317
git rev-list --objects --all >all_blobs &&
318318
! grep $hash all_blobs &&
319319
@@ -380,7 +380,7 @@ test_expect_success SYMLINKS 'rename/add, where add is a mode conflict' '
380380
# First, check that the bar that appears at stage 3 does not
381381
# correspond to an individual blob anywhere in history
382382
#
383-
hash=$(cat out | tr "\0" "\n" | head -n 3 | grep 3.bar | cut -f 2 -d " ") &&
383+
hash=$(tr "\0" "\n" <out | head -n 3 | grep 3.bar | cut -f 2 -d " ") &&
384384
git rev-list --objects --all >all_blobs &&
385385
! grep $hash all_blobs &&
386386
@@ -630,8 +630,8 @@ test_expect_success 'mod6: chains of rename/rename(1to2) and add/add via collidi
630630
# conflict entries do not appear as individual blobs anywhere
631631
# in history.
632632
#
633-
hash1=$(cat out | tr "\0" "\n" | head | grep 2.four | cut -f 2 -d " ") &&
634-
hash2=$(cat out | tr "\0" "\n" | head | grep 3.two | cut -f 2 -d " ") &&
633+
hash1=$(tr "\0" "\n" <out | head | grep 2.four | cut -f 2 -d " ") &&
634+
hash2=$(tr "\0" "\n" <out | head | grep 3.two | cut -f 2 -d " ") &&
635635
git rev-list --objects --all >all_blobs &&
636636
! grep $hash1 all_blobs &&
637637
! grep $hash2 all_blobs &&

0 commit comments

Comments
 (0)