Browse Source

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>
maint
Denton Liu 5 years ago committed by Junio C Hamano
parent
commit
fa87b81385
  1. 27
      t/t4108-apply-threeway.sh

27
t/t4108-apply-threeway.sh

@ -4,13 +4,6 @@ test_description='git apply --3way' @@ -4,13 +4,6 @@ test_description='git apply --3way'

. ./test-lib.sh

create_file () {
for i
do
echo "$i"
done
}

sanitize_conflicted_diff () {
sed -e '
/^index /d
@ -20,7 +13,7 @@ sanitize_conflicted_diff () { @@ -20,7 +13,7 @@ sanitize_conflicted_diff () {

test_expect_success setup '
test_tick &&
create_file >one 1 2 3 4 5 6 7 &&
test_write_lines 1 2 3 4 5 6 7 >one &&
cat one >two &&
git add one two &&
git commit -m initial &&
@ -28,13 +21,13 @@ test_expect_success setup ' @@ -28,13 +21,13 @@ test_expect_success setup '
git branch side &&

test_tick &&
create_file >one 1 two 3 4 5 six 7 &&
create_file >two 1 two 3 4 5 6 7 &&
test_write_lines 1 two 3 4 5 six 7 >one &&
test_write_lines 1 two 3 4 5 6 7 >two &&
git commit -a -m master &&

git checkout side &&
create_file >one 1 2 3 4 five 6 7 &&
create_file >two 1 2 3 4 five 6 7 &&
test_write_lines 1 2 3 4 five 6 7 >one &&
test_write_lines 1 2 3 4 five 6 7 >two &&
git commit -a -m side &&

git checkout master
@ -87,7 +80,7 @@ test_expect_success 'apply with --3way with rerere enabled' ' @@ -87,7 +80,7 @@ test_expect_success 'apply with --3way with rerere enabled' '
test_must_fail git merge --no-commit side &&

# Manually resolve and record the resolution
create_file 1 two 3 4 five six 7 >one &&
test_write_lines 1 two 3 4 five six 7 >one &&
git rerere &&
cat one >expect &&

@ -104,14 +97,14 @@ test_expect_success 'apply -3 with add/add conflict setup' ' @@ -104,14 +97,14 @@ test_expect_success 'apply -3 with add/add conflict setup' '
git reset --hard &&

git checkout -b adder &&
create_file 1 2 3 4 5 6 7 >three &&
create_file 1 2 3 4 5 6 7 >four &&
test_write_lines 1 2 3 4 5 6 7 >three &&
test_write_lines 1 2 3 4 5 6 7 >four &&
git add three four &&
git commit -m "add three and four" &&

git checkout -b another adder^ &&
create_file 1 2 3 4 5 6 7 >three &&
create_file 1 2 3 four 5 6 7 >four &&
test_write_lines 1 2 3 4 5 6 7 >three &&
test_write_lines 1 2 3 four 5 6 7 >four &&
git add three four &&
git commit -m "add three and four" &&


Loading…
Cancel
Save