Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2021-12-09 08:11:01 +0300
committerJunio C Hamano <gitster@pobox.com>2021-12-13 21:29:48 +0300
commite57ea501d00eab6191993f35e502aface5ceac5e (patch)
treea0e43bed2a609bdc750b81c5b68e9d0add6a5d77 /t/t5516-fetch-push.sh
parent88511d271b503e7e4681d7d8ae01cd3ee3294e35 (diff)
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>
Diffstat (limited to 't/t5516-fetch-push.sh')
-rwxr-xr-xt/t5516-fetch-push.sh5
1 files changed, 1 insertions, 4 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 8212ca56dc..d5e19b54af 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -1316,10 +1316,7 @@ test_expect_success 'fetch follows tags by default' '
git pull ../testrepo main &&
git tag -m "annotated" tag &&
git for-each-ref >tmp1 &&
- (
- cat tmp1
- sed -n "s|refs/heads/main$|refs/remotes/origin/main|p" tmp1
- ) |
+ sed -n "p; s|refs/heads/main$|refs/remotes/origin/main|p" tmp1 |
sort -k 3 >../expect
) &&
git init dst &&