aboutsummaryrefslogtreecommitdiffstats
path: root/t/t6437-submodule-merge.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t6437-submodule-merge.sh')
-rwxr-xr-xt/t6437-submodule-merge.sh65
1 files changed, 20 insertions, 45 deletions
diff --git a/t/t6437-submodule-merge.sh b/t/t6437-submodule-merge.sh
index 4815559157..a564758f52 100755
--- a/t/t6437-submodule-merge.sh
+++ b/t/t6437-submodule-merge.sh
@@ -9,7 +9,6 @@ GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB=1
export GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB
. ./test-lib.sh
-. "$TEST_DIRECTORY"/lib-merge.sh
#
# history
@@ -110,14 +109,10 @@ test_expect_success 'merging should conflict for non fast-forward' '
test_when_finished "git -C merge-search reset --hard" &&
(cd merge-search &&
git checkout -b test-nonforward-a b &&
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
- then
- test_must_fail git merge c 2>actual &&
- sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
- grep "$sub_expect" actual
- else
- test_must_fail git merge c 2> actual
- fi)
+ test_must_fail git merge c 2>actual &&
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
+ grep "$sub_expect" actual
+ )
'
test_expect_success 'finish setup for merge-search' '
@@ -151,14 +146,9 @@ test_expect_success 'merging should conflict for non fast-forward (resolution ex
git checkout -b test-nonforward-b b &&
(cd sub &&
git rev-parse --short sub-d > ../expect) &&
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
- then
- test_must_fail git merge c >actual 2>sub-actual &&
- sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
- grep "$sub_expect" sub-actual
- else
- test_must_fail git merge c 2> actual
- fi &&
+ test_must_fail git merge c >actual 2>sub-actual &&
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
+ grep "$sub_expect" sub-actual &&
grep $(cat expect) actual > /dev/null &&
git reset --hard)
'
@@ -169,23 +159,12 @@ test_expect_success 'merging should fail for ambiguous common parent' '
(cd sub &&
git checkout -b ambiguous sub-b &&
git merge sub-c &&
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
- then
- git rev-parse --short sub-d >../expect1 &&
- git rev-parse --short ambiguous >../expect2
- else
- git rev-parse sub-d > ../expect1 &&
- git rev-parse ambiguous > ../expect2
- fi
+ git rev-parse --short sub-d >../expect1 &&
+ git rev-parse --short ambiguous >../expect2
) &&
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
- then
- test_must_fail git merge c >actual 2>sub-actual &&
- sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
- grep "$sub_expect" sub-actual
- else
- test_must_fail git merge c 2> actual
- fi &&
+ test_must_fail git merge c >actual 2>sub-actual &&
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-c)" &&
+ grep "$sub_expect" sub-actual &&
grep $(cat expect1) actual > /dev/null &&
grep $(cat expect2) actual > /dev/null &&
git reset --hard)
@@ -227,11 +206,9 @@ test_expect_success 'merging should fail for changes that are backwards' '
git checkout -b test-backward e &&
test_must_fail git merge f 2>actual &&
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
- then
- sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-d)" &&
- grep "$sub_expect" actual
- fi)
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short sub-d)" &&
+ grep "$sub_expect" actual
+ )
'
@@ -358,7 +335,7 @@ test_expect_success 'setup file/submodule conflict' '
)
'
-test_expect_merge_algorithm failure success 'file/submodule conflict' '
+test_expect_success 'file/submodule conflict' '
test_when_finished "git -C file-submodule reset --hard" &&
(
cd file-submodule &&
@@ -467,7 +444,7 @@ test_expect_failure 'directory/submodule conflict; keep submodule clean' '
)
'
-test_expect_merge_algorithm failure success !FAIL_PREREQS 'directory/submodule conflict; should not treat submodule files as untracked or in the way' '
+test_expect_success !FAIL_PREREQS 'directory/submodule conflict; should not treat submodule files as untracked or in the way' '
test_when_finished "git -C directory-submodule/path reset --hard" &&
test_when_finished "git -C directory-submodule reset --hard" &&
(
@@ -535,11 +512,9 @@ test_expect_success 'merging should fail with no merge base' '
git add sub &&
git commit -m "b" &&
test_must_fail git merge a 2>actual &&
- if test "$GIT_TEST_MERGE_ALGORITHM" = ort
- then
- sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short HEAD^1)" &&
- grep "$sub_expect" actual
- fi)
+ sub_expect="go to submodule (sub), and either merge commit $(git -C sub rev-parse --short HEAD^1)" &&
+ grep "$sub_expect" actual
+ )
'
test_done