diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2021-12-09 08:11:05 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-13 21:29:48 +0300 |
commit | 0849541268a3aca9381591aed87b6864a203709b (patch) | |
tree | 00aa5e565425fd234928d17ad17e91c521d01d38 /t/t6409-merge-subtree.sh | |
parent | 020b813f400b55528edca00aff4d8e95080376f6 (diff) |
tests: use test_write_lines() to generate line-oriented output
Take advantage of test_write_lines() to generate line-oriented output
rather than using for-loops or a series of `echo` commands. Not only is
test_write_lines() a natural fit for such a task, but there is less
opportunity for a broken &&-chain.
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/t6409-merge-subtree.sh')
-rwxr-xr-x | t/t6409-merge-subtree.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t6409-merge-subtree.sh b/t/t6409-merge-subtree.sh index ba7890ec52..e9ba6f1690 100755 --- a/t/t6409-merge-subtree.sh +++ b/t/t6409-merge-subtree.sh @@ -10,7 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME test_expect_success setup ' s="1 2 3 4 5 6 7 8" && - for i in $s; do echo $i; done >hello && + test_write_lines $s >hello && git add hello && git commit -m initial && git checkout -b side && @@ -18,7 +18,7 @@ test_expect_success setup ' git add hello && git commit -m second && git checkout main && - for i in mundo $s; do echo $i; done >hello && + test_write_lines mundo $s >hello && git add hello && git commit -m main @@ -27,7 +27,7 @@ test_expect_success setup ' test_expect_success 'subtree available and works like recursive' ' git merge -s subtree side && - for i in mundo $s world; do echo $i; done >expect && + test_write_lines mundo $s world >expect && test_cmp expect hello ' |