Skip to content

Commit 4d175ef

Browse files
Miklos Vajnagitster
authored andcommitted
t7601: extend the 'merge picks up the best result' test
The test only checked if the best result picking code works if there are multiple strategies set in the config. Add a similar one that tests if the same true if the -s option of git merge was used multiple times. Signed-off-by: Miklos Vajna <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2d71bde commit 4d175ef

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

t/t7601-merge-pull-config.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,21 @@ test_expect_success 'setup conflicted merge' '
112112
# recusive is choosen.
113113

114114
test_expect_success 'merge picks up the best result' '
115+
git config --unset-all pull.twohead &&
116+
git reset --hard c5 &&
117+
git merge -s resolve c6
118+
resolve_count=$(conflict_count) &&
119+
git reset --hard c5 &&
120+
git merge -s recursive c6
121+
recursive_count=$(conflict_count) &&
122+
git reset --hard c5 &&
123+
git merge -s recursive -s resolve c6
124+
auto_count=$(conflict_count) &&
125+
test $auto_count = $recursive_count &&
126+
test $auto_count != $resolve_count
127+
'
128+
129+
test_expect_success 'merge picks up the best result (from config)' '
115130
git config pull.twohead "recursive resolve" &&
116131
git reset --hard c5 &&
117132
git merge -s resolve c6

0 commit comments

Comments
 (0)