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 <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Denton Liu committed
Oct 23, 2019 at 16:32 UTC
fa87b813853b12fee2a931c6084134fe1eea3b55
1 file changed
+10
-17
t/t4108-apply-threeway.sh
+10
-17
@@ -4,13 +4,6 @@ test_description='git apply --3way'
4
5
. ./test-lib.sh
6
7
-create_file () {
8
- for i
9
- do
10
- echo "$i"
11
- done
12
-}
13
-
7
sanitize_conflicted_diff () {
8
sed -e '
9
/^index /d
@@ -20,7 +13,7 @@ sanitize_conflicted_diff () {
13
14
test_expect_success setup '
15
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 &&
17
cat one >two &&
18
git add one two &&
19
git commit -m initial &&
@@ -28,13 +21,13 @@ test_expect_success setup '
21
git branch side &&
22
23
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 &&
26
git commit -a -m master &&
27
28
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 &&
31
git commit -a -m side &&
32
33
git checkout master
@@ -87,7 +80,7 @@ test_expect_success 'apply with --3way with rerere enabled' '
80
test_must_fail git merge --no-commit side &&
81
82
# 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 &&
84
git rerere &&
85
cat one >expect &&
86
@@ -104,14 +97,14 @@ test_expect_success 'apply -3 with add/add conflict setup' '
97
git reset --hard &&
98
99
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 &&
102
git add three four &&
103
git commit -m "add three and four" &&
104
105
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 &&
108
git add three four &&
109
git commit -m "add three and four" &&
110