Skip to content

Commit fa87b81

Browse files
Denton-Lgitster
authored andcommitted
t4108: replace create_file with test_write_lines
Since the locally defined create_file() duplicates the functionality of the test_write_lines() helper function, remove create_file() and replace all instances with test_write_lines(). While we're at it, move redirection operators to the end of the command which is the more conventional place to put it. Signed-off-by: Denton Liu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5fa0f52 commit fa87b81

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

t/t4108-apply-threeway.sh

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ test_description='git apply --3way'
44

55
. ./test-lib.sh
66

7-
create_file () {
8-
for i
9-
do
10-
echo "$i"
11-
done
12-
}
13-
147
sanitize_conflicted_diff () {
158
sed -e '
169
/^index /d
@@ -20,21 +13,21 @@ sanitize_conflicted_diff () {
2013

2114
test_expect_success setup '
2215
test_tick &&
23-
create_file >one 1 2 3 4 5 6 7 &&
16+
test_write_lines 1 2 3 4 5 6 7 >one &&
2417
cat one >two &&
2518
git add one two &&
2619
git commit -m initial &&
2720
2821
git branch side &&
2922
3023
test_tick &&
31-
create_file >one 1 two 3 4 5 six 7 &&
32-
create_file >two 1 two 3 4 5 6 7 &&
24+
test_write_lines 1 two 3 4 5 six 7 >one &&
25+
test_write_lines 1 two 3 4 5 6 7 >two &&
3326
git commit -a -m master &&
3427
3528
git checkout side &&
36-
create_file >one 1 2 3 4 five 6 7 &&
37-
create_file >two 1 2 3 4 five 6 7 &&
29+
test_write_lines 1 2 3 4 five 6 7 >one &&
30+
test_write_lines 1 2 3 4 five 6 7 >two &&
3831
git commit -a -m side &&
3932
4033
git checkout master
@@ -87,7 +80,7 @@ test_expect_success 'apply with --3way with rerere enabled' '
8780
test_must_fail git merge --no-commit side &&
8881
8982
# Manually resolve and record the resolution
90-
create_file 1 two 3 4 five six 7 >one &&
83+
test_write_lines 1 two 3 4 five six 7 >one &&
9184
git rerere &&
9285
cat one >expect &&
9386
@@ -104,14 +97,14 @@ test_expect_success 'apply -3 with add/add conflict setup' '
10497
git reset --hard &&
10598
10699
git checkout -b adder &&
107-
create_file 1 2 3 4 5 6 7 >three &&
108-
create_file 1 2 3 4 5 6 7 >four &&
100+
test_write_lines 1 2 3 4 5 6 7 >three &&
101+
test_write_lines 1 2 3 4 5 6 7 >four &&
109102
git add three four &&
110103
git commit -m "add three and four" &&
111104
112105
git checkout -b another adder^ &&
113-
create_file 1 2 3 4 5 6 7 >three &&
114-
create_file 1 2 3 four 5 6 7 >four &&
106+
test_write_lines 1 2 3 4 5 6 7 >three &&
107+
test_write_lines 1 2 3 four 5 6 7 >four &&
115108
git add three four &&
116109
git commit -m "add three and four" &&
117110

0 commit comments

Comments
 (0)