Skip to content

Commit e57ea50

Browse files
sunshinecogitster
authored andcommitted
t5516: drop unnecessary subshell and command invocation
To create its "expect" file, this test pipes into `sort` the output of `git for-each-ref` and a copy of that same output but with a minor textual transformation applied. To do so, it employs a subshell and commands `cat` and `sed` even though the same result can be accomplished by `sed` alone (without a subshell). Signed-off-by: Eric Sunshine <[email protected]> Reviewed-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 88511d2 commit e57ea50

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

t/t5516-fetch-push.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,10 +1316,7 @@ test_expect_success 'fetch follows tags by default' '
13161316
git pull ../testrepo main &&
13171317
git tag -m "annotated" tag &&
13181318
git for-each-ref >tmp1 &&
1319-
(
1320-
cat tmp1
1321-
sed -n "s|refs/heads/main$|refs/remotes/origin/main|p" tmp1
1322-
) |
1319+
sed -n "p; s|refs/heads/main$|refs/remotes/origin/main|p" tmp1 |
13231320
sort -k 3 >../expect
13241321
) &&
13251322
git init dst &&

0 commit comments

Comments
 (0)