tests: simplify by dropping unnecessary for
loops
Rather than manually looping over a set of items and plugging those items into a template string which is printed repeatedly, achieve the same effect by taking advantage of `printf` which loops over its arguments automatically. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
03949e33f5
commit
efe26b9ee0
@ -8,7 +8,7 @@ test_description='Tests for "git reset" with "--merge" and "--keep" options'
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success setup '
|
||||
for i in 1 2 3; do echo line $i; done >file1 &&
|
||||
printf "line %d\n" 1 2 3 >file1 &&
|
||||
cat file1 >file2 &&
|
||||
git add file1 file2 &&
|
||||
test_tick &&
|
||||
|
Reference in New Issue
Block a user