Skip to content

Commit d54e189

Browse files
phillipwoodgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 53f9a3e commit d54e189

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

t/t3430-rebase-merges.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ Initial setup:
1313
-- B -- (first)
1414
/ \
1515
A - C - D - E - H (master)
16-
\ /
17-
F - G (second)
16+
\ \ /
17+
\ F - G (second)
18+
\
19+
Conflicting-G
1820
'
1921
. ./test-lib.sh
2022
. "$TEST_DIRECTORY"/lib-rebase.sh
@@ -49,7 +51,9 @@ test_expect_success 'setup' '
4951
git merge --no-commit G &&
5052
test_tick &&
5153
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
5357
'
5458

5559
test_expect_success 'create completely different structure' '
@@ -72,7 +76,7 @@ test_expect_success 'create completely different structure' '
7276
EOF
7377
test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
7478
test_tick &&
75-
git rebase -i -r A &&
79+
git rebase -i -r A master &&
7680
test_cmp_graph <<-\EOF
7781
* Merge the topic branch '\''onebranch'\''
7882
|\
@@ -141,8 +145,7 @@ test_expect_success 'failed `merge` writes patch (may be rescheduled, too)' '
141145
142146
: fail because of merge conflict &&
143147
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 &&
146149
test_must_fail git rebase --continue &&
147150
! grep "^merge -C .* G$" .git/rebase-merge/git-rebase-todo &&
148151
test_path_is_file .git/rebase-merge/patch

0 commit comments

Comments
 (0)