Skip to content

Commit fd6852c

Browse files
Denton-Lgitster
authored andcommitted
t7600: use test_write_lines()
In t7600, we were rewriting `printf '%s\n' ...` to create files from parameters, one per line. However, we already have a function that wraps this for us: test_write_lines(). Rewrite these instances to use that function instead of open coding it. Signed-off-by: Denton Liu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 805d9ea commit fd6852c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

t/t7600-merge.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ Testing basic merge operations/option parsing.
2929
. ./test-lib.sh
3030
. "$TEST_DIRECTORY"/lib-gpg.sh
3131

32-
printf '%s\n' 1 2 3 4 5 6 7 8 9 >file
33-
printf '%s\n' '1 X' 2 3 4 5 6 7 8 9 >file.1
34-
printf '%s\n' 1 2 3 4 '5 X' 6 7 8 9 >file.5
35-
printf '%s\n' 1 2 3 4 5 6 7 8 '9 X' >file.9
36-
printf '%s\n' 1 2 3 4 5 6 7 8 '9 Y' >file.9y
37-
printf '%s\n' '1 X' 2 3 4 5 6 7 8 9 >result.1
38-
printf '%s\n' '1 X' 2 3 4 '5 X' 6 7 8 9 >result.1-5
39-
printf '%s\n' '1 X' 2 3 4 '5 X' 6 7 8 '9 X' >result.1-5-9
40-
printf '%s\n' 1 2 3 4 5 6 7 8 '9 Z' >result.9z
32+
test_write_lines 1 2 3 4 5 6 7 8 9 >file
33+
test_write_lines '1 X' 2 3 4 5 6 7 8 9 >file.1
34+
test_write_lines 1 2 3 4 '5 X' 6 7 8 9 >file.5
35+
test_write_lines 1 2 3 4 5 6 7 8 '9 X' >file.9
36+
test_write_lines 1 2 3 4 5 6 7 8 '9 Y' >file.9y
37+
test_write_lines '1 X' 2 3 4 5 6 7 8 9 >result.1
38+
test_write_lines '1 X' 2 3 4 '5 X' 6 7 8 9 >result.1-5
39+
test_write_lines '1 X' 2 3 4 '5 X' 6 7 8 '9 X' >result.1-5-9
40+
test_write_lines 1 2 3 4 5 6 7 8 '9 Z' >result.9z
4141

4242
create_merge_msgs () {
4343
echo "Merge tag 'c2'" >msg.1-5 &&
@@ -81,7 +81,7 @@ verify_head () {
8181
}
8282

8383
verify_parents () {
84-
printf '%s\n' "$@" >parents.expected &&
84+
test_write_lines "$@" >parents.expected &&
8585
>parents.actual &&
8686
i=1 &&
8787
while test $i -le $#
@@ -95,7 +95,7 @@ verify_parents () {
9595
}
9696

9797
verify_mergeheads () {
98-
printf '%s\n' "$@" >mergehead.expected &&
98+
test_write_lines "$@" >mergehead.expected &&
9999
while read sha1 rest
100100
do
101101
git rev-parse $sha1

0 commit comments

Comments
 (0)