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 <sunshine@sunshineco.com> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Eric Sunshine committed
Dec 9, 2021 at 00:11 UTC
e57ea501d00eab6191993f35e502aface5ceac5e
1 file changed
+1
-4
t/t5516-fetch-push.sh
+1
-4
@@ -1316,10 +1316,7 @@ test_expect_success 'fetch follows tags by default' '
1316
git pull ../testrepo main &&
1317
git tag -m "annotated" tag &&
1318
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 |
1320
sort -k 3 >../expect
1321
) &&
1322
git init dst &&