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>
Michael Haggerty committed
Dec 7, 2009 at 05:22 UTC
163f3925902446735b2f631dc44ab67882a93024
1 file changed
+20
-46
t/t3404-rebase-interactive.sh
+20
-46
@@ -16,53 +16,26 @@ set_fake_editor
16
17
# set up two branches like this:
18
#
19
-# A - B - C - D - E
19
+# A - B - C - D - E (master)
20
# \
21
-# F - G - H
21
+# F - G - H (branch1)
22
# \
23
-# I
23
+# I (branch2)
24
#
25
-# where B, D and G touch the same file.
25
+# where A, B, D and G touch the same file.
26
27
test_expect_success 'setup' '
28
- : > file1 &&
29
- git add file1 &&
30
- test_tick &&
31
- git commit -m A &&
32
- git tag A &&
33
- echo 1 > file1 &&
34
- test_tick &&
35
- git commit -m B file1 &&
36
- : > file2 &&
37
- git add file2 &&
38
- test_tick &&
39
- git commit -m C &&
40
- echo 2 > file1 &&
41
- test_tick &&
42
- git commit -m D file1 &&
43
- : > file3 &&
44
- git add file3 &&
45
- test_tick &&
46
- git commit -m E &&
28
+ test_commit A file1 &&
29
+ test_commit B file1 &&
30
+ test_commit C file2 &&
31
+ test_commit D file1 &&
32
+ test_commit E file3 &&
33
git checkout -b branch1 A &&
48
- : > file4 &&
49
- git add file4 &&
50
- test_tick &&
51
- git commit -m F &&
52
- git tag F &&
53
- echo 3 > file1 &&
54
- test_tick &&
55
- git commit -m G file1 &&
56
- : > file5 &&
57
- git add file5 &&
58
- test_tick &&
59
- git commit -m H &&
34
+ test_commit F file4 &&
35
+ test_commit G file1 &&
36
+ test_commit H file5 &&
37
git checkout -b branch2 F &&
61
- : > file6 &&
62
- git add file6 &&
63
- test_tick &&
64
- git commit -m I &&
65
- git tag I
38
+ test_commit I file6
39
'
40
41
test_expect_success 'no changes are a nop' '
@@ -111,19 +84,20 @@ test_expect_success 'exchange two commits' '
84
85
cat > expect << EOF
86
diff --git a/file1 b/file1
114
-index e69de29..00750ed 100644
87
+index f70f10e..fd79235 100644
88
--- a/file1
89
+++ b/file1
117
-@@ -0,0 +1 @@
118
-+3
90
+@@ -1 +1 @@
91
+-A
92
++G
93
EOF
94
95
cat > expect2 << EOF
96
<<<<<<< HEAD
123
-2
97
+D
98
=======
125
-3
126
->>>>>>> b7ca976... G
99
+G
100
+>>>>>>> 91201e5... G
101
EOF
102
103
test_expect_success 'stop on conflicting pick' '