Browse Source

t3404: Use test_commit to set up test repository

Also adjust "expected" text to reflect the file contents generated by
test_commit, which are slightly different than those generated by the
old code.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Michael Haggerty 15 years ago committed by Junio C Hamano
parent
commit
163f392590
  1. 66
      t/t3404-rebase-interactive.sh

66
t/t3404-rebase-interactive.sh

@ -16,53 +16,26 @@ set_fake_editor


# set up two branches like this: # set up two branches like this:
# #
# A - B - C - D - E # A - B - C - D - E (master)
# \ # \
# F - G - H # F - G - H (branch1)
# \ # \
# I # I (branch2)
# #
# where B, D and G touch the same file. # where A, B, D and G touch the same file.


test_expect_success 'setup' ' test_expect_success 'setup' '
: > file1 && test_commit A file1 &&
git add file1 && test_commit B file1 &&
test_tick && test_commit C file2 &&
git commit -m A && test_commit D file1 &&
git tag A && test_commit E file3 &&
echo 1 > file1 &&
test_tick &&
git commit -m B file1 &&
: > file2 &&
git add file2 &&
test_tick &&
git commit -m C &&
echo 2 > file1 &&
test_tick &&
git commit -m D file1 &&
: > file3 &&
git add file3 &&
test_tick &&
git commit -m E &&
git checkout -b branch1 A && git checkout -b branch1 A &&
: > file4 && test_commit F file4 &&
git add file4 && test_commit G file1 &&
test_tick && test_commit H file5 &&
git commit -m F &&
git tag F &&
echo 3 > file1 &&
test_tick &&
git commit -m G file1 &&
: > file5 &&
git add file5 &&
test_tick &&
git commit -m H &&
git checkout -b branch2 F && git checkout -b branch2 F &&
: > file6 && test_commit I file6
git add file6 &&
test_tick &&
git commit -m I &&
git tag I
' '


test_expect_success 'no changes are a nop' ' test_expect_success 'no changes are a nop' '
@ -111,19 +84,20 @@ test_expect_success 'exchange two commits' '


cat > expect << EOF cat > expect << EOF
diff --git a/file1 b/file1 diff --git a/file1 b/file1
index e69de29..00750ed 100644 index f70f10e..fd79235 100644
--- a/file1 --- a/file1
+++ b/file1 +++ b/file1
@@ -0,0 +1 @@ @@ -1 +1 @@
+3 -A
+G
EOF EOF


cat > expect2 << EOF cat > expect2 << EOF
<<<<<<< HEAD <<<<<<< HEAD
2 D
======= =======
3 G
>>>>>>> b7ca976... G >>>>>>> 91201e5... G
EOF EOF


test_expect_success 'stop on conflicting pick' ' test_expect_success 'stop on conflicting pick' '

Loading…
Cancel
Save