t3430: add conflicting commit
Move the creation of conflicting-G from a test to the setup so that it can be used in subsequent tests without creating the kind of implicit dependencies that plague t3404. While we're at it simplify the arguments to the test_commit() call the creates the conflicting commit. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Phillip Wood committed
Aug 15, 2018 at 10:39 UTC
d54e18986291474f077283c9d4cb5e970e1373a4
1 file changed
+9
-6
t/t3430-rebase-merges.sh
+9
-6
@@ -13,8 +13,10 @@ Initial setup:
13
-- B -- (first)
14
/ \
15
A - C - D - E - H (master)
16
- \ /
17
- F - G (second)
16
+ \ \ /
17
+ \ F - G (second)
18
+ \
19
+ Conflicting-G
20
'
21
. ./test-lib.sh
22
. "$TEST_DIRECTORY"/lib-rebase.sh
@@ -49,7 +51,9 @@ test_expect_success 'setup' '
51
git merge --no-commit G &&
52
test_tick &&
53
git commit -m H &&
52
- git tag -m H H
54
+ git tag -m H H &&
55
+ git checkout A &&
56
+ test_commit conflicting-G G.t
57
'
58
59
test_expect_success 'create completely different structure' '
@@ -72,7 +76,7 @@ test_expect_success 'create completely different structure' '
76
EOF
77
test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
78
test_tick &&
75
- git rebase -i -r A &&
79
+ git rebase -i -r A master &&
80
test_cmp_graph <<-\EOF
81
* Merge the topic branch '\''onebranch'\''
82
|\
@@ -141,8 +145,7 @@ test_expect_success 'failed `merge` writes patch (may be rescheduled, too)' '
145
146
: fail because of merge conflict &&
147
rm G.t .git/rebase-merge/patch &&
144
- git reset --hard &&
145
- test_commit conflicting-G G.t not-G conflicting-G &&
148
+ git reset --hard conflicting-G &&
149
test_must_fail git rebase --continue &&
150
! grep "^merge -C .* G$" .git/rebase-merge/git-rebase-todo &&
151
test_path_is_file .git/rebase-merge/patch