summaryrefslogtreecommitdiff
path: root/t/t6417-merge-ours-theirs.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t6417-merge-ours-theirs.sh')
-rwxr-xr-xt/t6417-merge-ours-theirs.sh31
1 files changed, 17 insertions, 14 deletions
diff --git a/t/t6417-merge-ours-theirs.sh b/t/t6417-merge-ours-theirs.sh
index 0aebc6c028..ac9aee9a66 100755
--- a/t/t6417-merge-ours-theirs.sh
+++ b/t/t6417-merge-ours-theirs.sh
@@ -1,6 +1,9 @@
#!/bin/sh
test_description='Merge-recursive ours and theirs variants'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
test_expect_success setup '
@@ -20,11 +23,11 @@ test_expect_success setup '
sed -e "s/9/nueve/" >file <elif &&
git commit -a -m theirs &&
- git checkout master^0
+ git checkout main^0
'
test_expect_success 'plain recursive - should conflict' '
- git reset --hard master &&
+ git reset --hard main &&
test_must_fail git merge -s recursive side &&
grep nine file &&
grep nueve file &&
@@ -34,7 +37,7 @@ test_expect_success 'plain recursive - should conflict' '
'
test_expect_success 'recursive favouring theirs' '
- git reset --hard master &&
+ git reset --hard main &&
git merge -s recursive -Xtheirs side &&
! grep nine file &&
grep nueve file &&
@@ -44,7 +47,7 @@ test_expect_success 'recursive favouring theirs' '
'
test_expect_success 'recursive favouring ours' '
- git reset --hard master &&
+ git reset --hard main &&
git merge -s recursive -X ours side &&
grep nine file &&
! grep nueve file &&
@@ -56,26 +59,26 @@ test_expect_success 'recursive favouring ours' '
test_expect_success 'binary file with -Xours/-Xtheirs' '
echo file binary >.gitattributes &&
- git reset --hard master &&
+ git reset --hard main &&
git merge -s recursive -X theirs side &&
git diff --exit-code side HEAD -- file &&
- git reset --hard master &&
+ git reset --hard main &&
git merge -s recursive -X ours side &&
- git diff --exit-code master HEAD -- file
+ git diff --exit-code main HEAD -- file
'
test_expect_success 'pull passes -X to underlying merge' '
- git reset --hard master && git pull -s recursive -Xours . side &&
- git reset --hard master && git pull -s recursive -X ours . side &&
- git reset --hard master && git pull -s recursive -Xtheirs . side &&
- git reset --hard master && git pull -s recursive -X theirs . side &&
- git reset --hard master && test_must_fail git pull -s recursive -X bork . side
+ git reset --hard main && git pull -s recursive -Xours . side &&
+ git reset --hard main && git pull -s recursive -X ours . side &&
+ git reset --hard main && git pull -s recursive -Xtheirs . side &&
+ git reset --hard main && git pull -s recursive -X theirs . side &&
+ git reset --hard main && test_must_fail git pull -s recursive -X bork . side
'
test_expect_success SYMLINKS 'symlink with -Xours/-Xtheirs' '
- git reset --hard master &&
- git checkout -b two master &&
+ git reset --hard main &&
+ git checkout -b two main &&
ln -s target-zero link &&
git add link &&
git commit -m "add link pointing to zero" &&