From 0849541268a3aca9381591aed87b6864a203709b Mon Sep 17 00:00:00 2001 From: Eric Sunshine Date: Thu, 9 Dec 2021 00:11:05 -0500 Subject: 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 Reviewed-by: Elijah Newren Signed-off-by: Junio C Hamano --- t/t7501-commit-basic-functionality.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 't/t7501-commit-basic-functionality.sh') diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh index 512ae2781f..fb5417d5e7 100755 --- a/t/t7501-commit-basic-functionality.sh +++ b/t/t7501-commit-basic-functionality.sh @@ -667,10 +667,7 @@ test_expect_success 'amend can copy notes' ' test_expect_success 'commit a file whose name is a dash' ' git reset --hard && - for i in 1 2 3 4 5 - do - echo $i - done >./- && + test_write_lines 1 2 3 4 5 >./- && git add ./- && test_tick && git commit -m "add dash" >output