t6[4-9]*: adjust the references to the default branch name "main"

This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t6[4-9]*.sh)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin
2020-11-18 23:44:38 +00:00
committed by Junio C Hamano
parent 1f53df54eb
commit 5902f5f460
27 changed files with 190 additions and 190 deletions

View File

@ -4,7 +4,7 @@
# #
test_description='Test merge with directory/file conflicts' test_description='Test merge with directory/file conflicts'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -27,12 +27,12 @@ test_expect_success 'prepare repository' '
' '
test_expect_success 'Merge with d/f conflicts' ' test_expect_success 'Merge with d/f conflicts' '
test_expect_code 1 git merge -m "merge msg" master test_expect_code 1 git merge -m "merge msg" main
' '
test_expect_success 'F/D conflict' ' test_expect_success 'F/D conflict' '
git reset --hard && git reset --hard &&
git checkout master && git checkout main &&
rm .git/index && rm .git/index &&
mkdir before && mkdir before &&
@ -50,7 +50,7 @@ test_expect_success 'F/D conflict' '
git add . && git add . &&
git commit -m para && git commit -m para &&
git merge master git merge main
' '
test_expect_success 'setup modify/delete + directory/file conflict' ' test_expect_success 'setup modify/delete + directory/file conflict' '

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
test_description='Merge-recursive merging renames' test_description='Merge-recursive merging renames'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -57,9 +57,9 @@ test_expect_success 'setup' '
git branch change && git branch change &&
git branch change+rename && git branch change+rename &&
sed -e "/^g /s/.*/g : master changes a line/" <A >A+ && sed -e "/^g /s/.*/g : main changes a line/" <A >A+ &&
mv A+ A && mv A+ A &&
git commit -a -m "master updates A" && git commit -a -m "main updates A" &&
git checkout yellow && git checkout yellow &&
rm -f M && rm -f M &&
@ -97,7 +97,7 @@ test_expect_success 'setup' '
git update-index --add B && git update-index --add B &&
git commit -q -a -m "changed and renamed" && git commit -q -a -m "changed and renamed" &&
git checkout master git checkout main
' '
test_expect_success 'pull renaming branch into unrenaming one' \ test_expect_success 'pull renaming branch into unrenaming one' \
@ -112,7 +112,7 @@ test_expect_success 'pull renaming branch into unrenaming one' \
sed -ne "/^g/{ sed -ne "/^g/{
p p
q q
}" B | grep master && }" B | grep main &&
git diff --exit-code white N git diff --exit-code white N
' '
@ -137,7 +137,7 @@ test_expect_success 'pull unrenaming branch into renaming one' \
' '
git reset --hard && git reset --hard &&
git show-branch && git show-branch &&
test_expect_code 1 git pull . master && test_expect_code 1 git pull . main &&
git ls-files -u B >b.stages && git ls-files -u B >b.stages &&
test_line_count = 3 b.stages && test_line_count = 3 b.stages &&
git ls-files -s N >n.stages && git ls-files -s N >n.stages &&
@ -190,7 +190,7 @@ test_expect_success 'interference with untracked working tree file' '
test_expect_success 'interference with untracked working tree file' ' test_expect_success 'interference with untracked working tree file' '
git reset --hard && git reset --hard &&
rm -f A M && rm -f A M &&
git checkout -f master && git checkout -f main &&
git tag -f anchor && git tag -f anchor &&
git show-branch && git show-branch &&
git pull . yellow && git pull . yellow &&
@ -201,7 +201,7 @@ test_expect_success 'interference with untracked working tree file' '
test_expect_success 'updated working tree file should prevent the merge' ' test_expect_success 'updated working tree file should prevent the merge' '
git reset --hard && git reset --hard &&
rm -f A M && rm -f A M &&
git checkout -f master && git checkout -f main &&
git tag -f anchor && git tag -f anchor &&
git show-branch && git show-branch &&
echo >>M one line addition && echo >>M one line addition &&
@ -214,7 +214,7 @@ test_expect_success 'updated working tree file should prevent the merge' '
test_expect_success 'updated working tree file should prevent the merge' ' test_expect_success 'updated working tree file should prevent the merge' '
git reset --hard && git reset --hard &&
rm -f A M && rm -f A M &&
git checkout -f master && git checkout -f main &&
git tag -f anchor && git tag -f anchor &&
git show-branch && git show-branch &&
echo >>M one line addition && echo >>M one line addition &&
@ -232,7 +232,7 @@ test_expect_success 'interference with untracked working tree file' '
git tag -f anchor && git tag -f anchor &&
git show-branch && git show-branch &&
echo >M this file should not matter && echo >M this file should not matter &&
git pull . master && git pull . main &&
test_path_is_file M && test_path_is_file M &&
! { ! {
git ls-files -s | git ls-files -s |
@ -767,7 +767,7 @@ test_expect_success 'setup avoid unnecessary update, dir->(file,nothing)' '
git rm -rf df && git rm -rf df &&
git commit -mB && git commit -mB &&
git checkout master && git checkout main &&
git rm -rf df && git rm -rf df &&
echo bla >df && echo bla >df &&
git add -A && git add -A &&
@ -775,7 +775,7 @@ test_expect_success 'setup avoid unnecessary update, dir->(file,nothing)' '
' '
test_expect_success 'avoid unnecessary update, dir->(file,nothing)' ' test_expect_success 'avoid unnecessary update, dir->(file,nothing)' '
git checkout -q master^0 && git checkout -q main^0 &&
test-tool chmtime --get -3600 df >expect && test-tool chmtime --get -3600 df >expect &&
git merge side && git merge side &&
test-tool chmtime --get df >actual && test-tool chmtime --get df >actual &&
@ -797,14 +797,14 @@ test_expect_success 'setup avoid unnecessary update, modify/delete' '
git rm -f file && git rm -f file &&
git commit -m "Delete file" && git commit -m "Delete file" &&
git checkout master && git checkout main &&
echo bla >file && echo bla >file &&
git add -A && git add -A &&
git commit -m "Modify file" git commit -m "Modify file"
' '
test_expect_success 'avoid unnecessary update, modify/delete' ' test_expect_success 'avoid unnecessary update, modify/delete' '
git checkout -q master^0 && git checkout -q main^0 &&
test-tool chmtime --get -3600 file >expect && test-tool chmtime --get -3600 file >expect &&
test_must_fail git merge side && test_must_fail git merge side &&
test-tool chmtime --get file >actual && test-tool chmtime --get file >actual &&
@ -826,13 +826,13 @@ test_expect_success 'setup avoid unnecessary update, rename/add-dest' '
git add -A && git add -A &&
git commit -m "Add file copy" && git commit -m "Add file copy" &&
git checkout master && git checkout main &&
git mv file newfile && git mv file newfile &&
git commit -m "Rename file" git commit -m "Rename file"
' '
test_expect_success 'avoid unnecessary update, rename/add-dest' ' test_expect_success 'avoid unnecessary update, rename/add-dest' '
git checkout -q master^0 && git checkout -q main^0 &&
test-tool chmtime --get -3600 newfile >expect && test-tool chmtime --get -3600 newfile >expect &&
git merge side && git merge side &&
test-tool chmtime --get newfile >actual && test-tool chmtime --get newfile >actual &&
@ -882,15 +882,15 @@ test_expect_success 'setup for use of extended merge markers' '
git mv original_file renamed_file && git mv original_file renamed_file &&
git commit -mB && git commit -mB &&
git checkout master && git checkout main &&
echo 8.5 >>original_file && echo 8.5 >>original_file &&
git add original_file && git add original_file &&
git commit -mC git commit -mC
' '
test_expect_success 'merge master into rename has correct extended markers' ' test_expect_success 'merge main into rename has correct extended markers' '
git checkout rename^0 && git checkout rename^0 &&
test_must_fail git merge -s recursive master^0 && test_must_fail git merge -s recursive main^0 &&
cat >expected <<-\EOF && cat >expected <<-\EOF &&
1 1
@ -905,14 +905,14 @@ test_expect_success 'merge master into rename has correct extended markers' '
9 9
======= =======
8.5 8.5
>>>>>>> master^0:original_file >>>>>>> main^0:original_file
EOF EOF
test_cmp expected renamed_file test_cmp expected renamed_file
' '
test_expect_success 'merge rename into master has correct extended markers' ' test_expect_success 'merge rename into main has correct extended markers' '
git reset --hard && git reset --hard &&
git checkout master^0 && git checkout main^0 &&
test_must_fail git merge -s recursive rename^0 && test_must_fail git merge -s recursive rename^0 &&
cat >expected <<-\EOF && cat >expected <<-\EOF &&
@ -948,13 +948,13 @@ test_expect_success 'setup spurious "refusing to lose untracked" message' '
git mv original_file renamed_file && git mv original_file renamed_file &&
git commit -mB && git commit -mB &&
git checkout master && git checkout main &&
git rm original_file && git rm original_file &&
git commit -mC git commit -mC
' '
test_expect_success 'no spurious "refusing to lose untracked" message' ' test_expect_success 'no spurious "refusing to lose untracked" message' '
git checkout master^0 && git checkout main^0 &&
test_must_fail git merge rename^0 2>errors.txt && test_must_fail git merge rename^0 2>errors.txt &&
! grep "refusing to lose untracked file" errors.txt ! grep "refusing to lose untracked file" errors.txt
' '

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
test_description='Test merge without common ancestors' test_description='Test merge without common ancestors'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -22,11 +22,11 @@ test_expect_success 'setup tests' '
git add a1 && git add a1 &&
GIT_AUTHOR_DATE="2006-12-12 23:00:00" git commit -m 1 a1 && GIT_AUTHOR_DATE="2006-12-12 23:00:00" git commit -m 1 a1 &&
git checkout -b A master && git checkout -b A main &&
echo A >a1 && echo A >a1 &&
GIT_AUTHOR_DATE="2006-12-12 23:00:01" git commit -m A a1 && GIT_AUTHOR_DATE="2006-12-12 23:00:01" git commit -m A a1 &&
git checkout -b B master && git checkout -b B main &&
echo B >a1 && echo B >a1 &&
GIT_AUTHOR_DATE="2006-12-12 23:00:02" git commit -m B a1 && GIT_AUTHOR_DATE="2006-12-12 23:00:02" git commit -m B a1 &&

View File

@ -8,7 +8,7 @@ test_description='merging symlinks on filesystem w/o symlink support.
This tests that git merge-recursive writes merge results as plain files This tests that git merge-recursive writes merge results as plain files
if core.symlinks is false.' if core.symlinks is false.'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -22,7 +22,7 @@ test_expect_success 'setup' '
git branch b-file && git branch b-file &&
l=$(printf file | git hash-object -t blob -w --stdin) && l=$(printf file | git hash-object -t blob -w --stdin) &&
echo "120000 $l symlink" | git update-index --index-info && echo "120000 $l symlink" | git update-index --index-info &&
git commit -m master && git commit -m main &&
git checkout b-symlink && git checkout b-symlink &&
l=$(printf file-different | git hash-object -t blob -w --stdin) && l=$(printf file-different | git hash-object -t blob -w --stdin) &&
echo "120000 $l symlink" | git update-index --index-info && echo "120000 $l symlink" | git update-index --index-info &&
@ -33,28 +33,28 @@ test_expect_success 'setup' '
git commit -m b-file git commit -m b-file
' '
test_expect_success 'merge master into b-symlink, which has a different symbolic link' ' test_expect_success 'merge main into b-symlink, which has a different symbolic link' '
git checkout b-symlink && git checkout b-symlink &&
test_must_fail git merge master test_must_fail git merge main
' '
test_expect_success 'the merge result must be a file' ' test_expect_success 'the merge result must be a file' '
test_path_is_file symlink test_path_is_file symlink
' '
test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' ' test_expect_success 'merge main into b-file, which has a file instead of a symbolic link' '
git reset --hard && git reset --hard &&
git checkout b-file && git checkout b-file &&
test_must_fail git merge master test_must_fail git merge main
' '
test_expect_success 'the merge result must be a file' ' test_expect_success 'the merge result must be a file' '
test_path_is_file symlink test_path_is_file symlink
' '
test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' ' test_expect_success 'merge b-file, which has a file instead of a symbolic link, into main' '
git reset --hard && git reset --hard &&
git checkout master && git checkout main &&
test_must_fail git merge b-file test_must_fail git merge b-file
' '

View File

@ -5,7 +5,7 @@
test_description='per path merge controlled by merge attribute' test_description='per path merge controlled by merge attribute'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -22,10 +22,10 @@ test_expect_success setup '
git branch side && git branch side &&
for f in text binary union for f in text binary union
do do
echo Master >>$f && git add $f || return 1 echo Main >>$f && git add $f || return 1
done && done &&
test_tick && test_tick &&
git commit -m Master && git commit -m Main &&
git checkout side && git checkout side &&
for f in text binary union for f in text binary union
@ -67,7 +67,7 @@ test_expect_success merge '
echo "union merge=union" echo "union merge=union"
} >.gitattributes && } >.gitattributes &&
if git merge master if git merge main
then then
echo Gaah, should have conflicted echo Gaah, should have conflicted
false false
@ -90,7 +90,7 @@ test_expect_success 'check merge result in working tree' '
grep "<<<<<<<" text && grep "<<<<<<<" text &&
cmp binary-orig binary && cmp binary-orig binary &&
! grep "<<<<<<<" union && ! grep "<<<<<<<" union &&
grep Master union && grep Main union &&
grep Side union grep Side union
' '
@ -118,13 +118,13 @@ test_expect_success 'custom merge backend' '
git config --replace-all \ git config --replace-all \
merge.custom.name "custom merge driver for testing" && merge.custom.name "custom merge driver for testing" &&
git merge master && git merge main &&
cmp binary union && cmp binary union &&
sed -e 1,3d text >check-1 && sed -e 1,3d text >check-1 &&
o=$(git unpack-file master^:text) && o=$(git unpack-file main^:text) &&
a=$(git unpack-file side^:text) && a=$(git unpack-file side^:text) &&
b=$(git unpack-file master:text) && b=$(git unpack-file main:text) &&
sh -c "./custom-merge $o $a $b 0 text" && sh -c "./custom-merge $o $a $b 0 text" &&
sed -e 1,3d $a >check-2 && sed -e 1,3d $a >check-2 &&
cmp check-1 check-2 && cmp check-1 check-2 &&
@ -139,7 +139,7 @@ test_expect_success 'custom merge backend' '
git config --replace-all \ git config --replace-all \
merge.custom.name "custom merge driver for testing" && merge.custom.name "custom merge driver for testing" &&
if git merge master if git merge main
then then
echo "Eh? should have conflicted" echo "Eh? should have conflicted"
false false
@ -149,9 +149,9 @@ test_expect_success 'custom merge backend' '
cmp binary union && cmp binary union &&
sed -e 1,3d text >check-1 && sed -e 1,3d text >check-1 &&
o=$(git unpack-file master^:text) && o=$(git unpack-file main^:text) &&
a=$(git unpack-file anchor:text) && a=$(git unpack-file anchor:text) &&
b=$(git unpack-file master:text) && b=$(git unpack-file main:text) &&
sh -c "./custom-merge $o $a $b 0 text" && sh -c "./custom-merge $o $a $b 0 text" &&
sed -e 1,3d $a >check-2 && sed -e 1,3d $a >check-2 &&
cmp check-1 check-2 && cmp check-1 check-2 &&
@ -179,7 +179,7 @@ test_expect_success 'up-to-date merge without common ancestor' '
test_tick && test_tick &&
( (
cd repo1 && cd repo1 &&
git fetch ../repo2 master && git fetch ../repo2 main &&
git merge --allow-unrelated-histories FETCH_HEAD git merge --allow-unrelated-histories FETCH_HEAD
) )
' '
@ -204,7 +204,7 @@ test_expect_success 'custom merge does not lock index' '
# By packaging the command in test_when_finished, we get both # By packaging the command in test_when_finished, we get both
# the correctness check and the clean-up. # the correctness check and the clean-up.
test_when_finished "kill \$(cat sleep.pid)" && test_when_finished "kill \$(cat sleep.pid)" &&
git merge master git merge main
' '
test_done test_done

View File

@ -2,7 +2,7 @@
test_description='ask merge-recursive to merge binary files' test_description='ask merge-recursive to merge binary files'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -23,7 +23,7 @@ test_expect_success setup '
git ls-files -s a >E0 && git ls-files -s a >E0 &&
git ls-files -s m | sed -e "s/ 0 / 3 /" >E3 && git ls-files -s m | sed -e "s/ 0 / 3 /" >E3 &&
test_tick && test_tick &&
git commit -m "master adds some" && git commit -m "main adds some" &&
git checkout side && git checkout side &&
echo rezrov >>m && echo rezrov >>m &&
@ -42,7 +42,7 @@ test_expect_success resolve '
rm -f a* m* && rm -f a* m* &&
git reset --hard anchor && git reset --hard anchor &&
if git merge -s resolve master if git merge -s resolve main
then then
echo Oops, should not have succeeded echo Oops, should not have succeeded
false false
@ -57,7 +57,7 @@ test_expect_success recursive '
rm -f a* m* && rm -f a* m* &&
git reset --hard anchor && git reset --hard anchor &&
if git merge -s recursive master if git merge -s recursive main
then then
echo Oops, should not have succeeded echo Oops, should not have succeeded
false false

View File

@ -2,7 +2,7 @@
test_description='subtree merge strategy' test_description='subtree merge strategy'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -17,10 +17,10 @@ test_expect_success setup '
echo >>hello world && echo >>hello world &&
git add hello && git add hello &&
git commit -m second && git commit -m second &&
git checkout master && git checkout main &&
for i in mundo $s; do echo $i; done >hello && for i in mundo $s; do echo $i; done >hello &&
git add hello && git add hello &&
git commit -m master git commit -m main
' '
@ -39,7 +39,7 @@ test_expect_success 'setup branch sub' '
' '
test_expect_success 'setup topic branch' ' test_expect_success 'setup topic branch' '
git checkout -b topic master && git checkout -b topic main &&
git merge -s ours --no-commit --allow-unrelated-histories sub && git merge -s ours --no-commit --allow-unrelated-histories sub &&
git read-tree --prefix=dir/ -u sub && git read-tree --prefix=dir/ -u sub &&
git commit -m "initial merge of sub into topic" && git commit -m "initial merge of sub into topic" &&
@ -80,8 +80,8 @@ test_expect_success 'setup' '
test_expect_success 'initial merge' ' test_expect_success 'initial merge' '
git remote add -f gui ../git-gui && git remote add -f gui ../git-gui &&
git merge -s ours --no-commit --allow-unrelated-histories gui/master && git merge -s ours --no-commit --allow-unrelated-histories gui/main &&
git read-tree --prefix=git-gui/ -u gui/master && git read-tree --prefix=git-gui/ -u gui/main &&
git commit -m "Merge git-gui as our subdirectory" && git commit -m "Merge git-gui as our subdirectory" &&
git checkout -b work && git checkout -b work &&
git ls-files -s >actual && git ls-files -s >actual &&
@ -111,10 +111,10 @@ test_expect_success 'merge update' '
test_expect_success 'initial ambiguous subtree' ' test_expect_success 'initial ambiguous subtree' '
cd ../git && cd ../git &&
git reset --hard master && git reset --hard main &&
git checkout -b topic_2 && git checkout -b topic_2 &&
git merge -s ours --no-commit gui/master && git merge -s ours --no-commit gui/main &&
git read-tree --prefix=git-gui2/ -u gui/master && git read-tree --prefix=git-gui2/ -u gui/main &&
git commit -m "Merge git-gui2 as our subdirectory" && git commit -m "Merge git-gui2 as our subdirectory" &&
git checkout -b work2 && git checkout -b work2 &&
git ls-files -s >actual && git ls-files -s >actual &&

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
test_description='merge: handle file mode' test_description='merge: handle file mode'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -10,11 +10,11 @@ test_expect_success 'set up mode change in one branch' '
: >file1 && : >file1 &&
git add file1 && git add file1 &&
git commit -m initial && git commit -m initial &&
git checkout -b a1 master && git checkout -b a1 main &&
: >dummy && : >dummy &&
git add dummy && git add dummy &&
git commit -m a && git commit -m a &&
git checkout -b b1 master && git checkout -b b1 main &&
test_chmod +x file1 && test_chmod +x file1 &&
git add file1 && git add file1 &&
git commit -m b1 git commit -m b1
@ -42,12 +42,12 @@ do_one_mode resolve b1 a1
test_expect_success 'set up mode change in both branches' ' test_expect_success 'set up mode change in both branches' '
git reset --hard HEAD && git reset --hard HEAD &&
git checkout -b a2 master && git checkout -b a2 main &&
: >file2 && : >file2 &&
H=$(git hash-object file2) && H=$(git hash-object file2) &&
test_chmod +x file2 && test_chmod +x file2 &&
git commit -m a2 && git commit -m a2 &&
git checkout -b b2 master && git checkout -b b2 main &&
: >file2 && : >file2 &&
git add file2 && git add file2 &&
git commit -m b2 && git commit -m b2 &&
@ -79,7 +79,7 @@ do_both_modes resolve
test_expect_success 'set up delete/modechange scenario' ' test_expect_success 'set up delete/modechange scenario' '
git reset --hard && git reset --hard &&
git checkout -b deletion master && git checkout -b deletion main &&
git rm file1 && git rm file1 &&
git commit -m deletion git commit -m deletion
' '

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
test_description='merging with large rename matrix' test_description='merging with large rename matrix'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -33,7 +33,7 @@ test_rename() {
test_expect_success "rename ($1, $2)" ' test_expect_success "rename ($1, $2)" '
n='$1' && n='$1' &&
expect='$2' && expect='$2' &&
git checkout -f master && git checkout -f main &&
test_might_fail git branch -D test$n && test_might_fail git branch -D test$n &&
git reset --hard initial && git reset --hard initial &&
for i in $(count $n); do for i in $(count $n); do
@ -53,8 +53,8 @@ test_rename() {
git add . && git add . &&
git commit -m change+rename=$n && git commit -m change+rename=$n &&
case "$expect" in case "$expect" in
ok) git merge master ;; ok) git merge main ;;
*) test_must_fail git merge master ;; *) test_must_fail git merge main ;;
esac esac
' '
} }

View File

@ -8,7 +8,7 @@ test_description='merge conflict in crlf repo
' '
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -27,7 +27,7 @@ test_expect_success setup '
echo line from b | append_cr >file && echo line from b | append_cr >file &&
git commit -m "add line from b" file && git commit -m "add line from b" file &&
git tag b && git tag b &&
git checkout master git checkout main
' '
test_expect_success 'Check "ours" is CRLF' ' test_expect_success 'Check "ours" is CRLF' '

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
test_description='Merge-recursive merging renames' test_description='Merge-recursive merging renames'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -68,7 +68,7 @@ test_expect_success 'setup' '
git update-index A && git update-index A &&
git commit -m "blue modify A" && git commit -m "blue modify A" &&
git checkout master git checkout main
' '
# This test broke in 65ac6e9c3f47807cb603af07a6a9e1a43bc119ae # This test broke in 65ac6e9c3f47807cb603af07a6a9e1a43bc119ae

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
test_description='merging when a directory was replaced with a symlink' test_description='merging when a directory was replaced with a symlink'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -22,7 +22,7 @@ test_expect_success 'create a commit where dir a/b changed to symlink' '
test_expect_success 'checkout does not clobber untracked symlink' ' test_expect_success 'checkout does not clobber untracked symlink' '
git checkout HEAD^0 && git checkout HEAD^0 &&
git reset --hard master && git reset --hard main &&
git rm --cached a/b && git rm --cached a/b &&
git commit -m "untracked symlink remains" && git commit -m "untracked symlink remains" &&
test_must_fail git checkout start^0 test_must_fail git checkout start^0
@ -30,7 +30,7 @@ test_expect_success 'checkout does not clobber untracked symlink' '
test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' ' test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '
git checkout HEAD^0 && git checkout HEAD^0 &&
git reset --hard master && git reset --hard main &&
git rm --cached a/b && git rm --cached a/b &&
git commit -m "untracked symlink remains" && git commit -m "untracked symlink remains" &&
git checkout -f start^0 && git checkout -f start^0 &&
@ -39,7 +39,7 @@ test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '
test_expect_success 'checkout should not have deleted a/b-2/c/d' ' test_expect_success 'checkout should not have deleted a/b-2/c/d' '
git checkout HEAD^0 && git checkout HEAD^0 &&
git reset --hard master && git reset --hard main &&
git checkout start^0 && git checkout start^0 &&
test_path_is_file a/b-2/c/d test_path_is_file a/b-2/c/d
' '
@ -56,7 +56,7 @@ test_expect_success 'setup for merge test' '
test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (resolve)' ' test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (resolve)' '
git reset --hard && git reset --hard &&
git checkout baseline^0 && git checkout baseline^0 &&
git merge -s resolve master && git merge -s resolve main &&
test_path_is_file a/b-2/c/d test_path_is_file a/b-2/c/d
' '
@ -67,7 +67,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' '
test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (recursive)' ' test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (recursive)' '
git reset --hard && git reset --hard &&
git checkout baseline^0 && git checkout baseline^0 &&
git merge -s recursive master && git merge -s recursive main &&
test_path_is_file a/b-2/c/d test_path_is_file a/b-2/c/d
' '
@ -77,7 +77,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' '
test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (resolve)' ' test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (resolve)' '
git reset --hard && git reset --hard &&
git checkout master^0 && git checkout main^0 &&
git merge -s resolve baseline^0 && git merge -s resolve baseline^0 &&
test_path_is_file a/b-2/c/d test_path_is_file a/b-2/c/d
' '
@ -88,7 +88,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' '
test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (recursive)' ' test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (recursive)' '
git reset --hard && git reset --hard &&
git checkout master^0 && git checkout main^0 &&
git merge -s recursive baseline^0 && git merge -s recursive baseline^0 &&
test_path_is_file a/b-2/c/d test_path_is_file a/b-2/c/d
' '
@ -101,7 +101,7 @@ test_expect_failure 'do not lose untracked in merge (resolve)' '
git reset --hard && git reset --hard &&
git checkout baseline^0 && git checkout baseline^0 &&
>a/b/c/e && >a/b/c/e &&
test_must_fail git merge -s resolve master && test_must_fail git merge -s resolve main &&
test_path_is_file a/b/c/e && test_path_is_file a/b/c/e &&
test_path_is_file a/b-2/c/d test_path_is_file a/b-2/c/d
' '
@ -110,7 +110,7 @@ test_expect_success 'do not lose untracked in merge (recursive)' '
git reset --hard && git reset --hard &&
git checkout baseline^0 && git checkout baseline^0 &&
>a/b/c/e && >a/b/c/e &&
test_must_fail git merge -s recursive master && test_must_fail git merge -s recursive main &&
test_path_is_file a/b/c/e && test_path_is_file a/b/c/e &&
test_path_is_file a/b-2/c/d test_path_is_file a/b-2/c/d
' '
@ -119,14 +119,14 @@ test_expect_success 'do not lose modifications in merge (resolve)' '
git reset --hard && git reset --hard &&
git checkout baseline^0 && git checkout baseline^0 &&
echo more content >>a/b/c/d && echo more content >>a/b/c/d &&
test_must_fail git merge -s resolve master test_must_fail git merge -s resolve main
' '
test_expect_success 'do not lose modifications in merge (recursive)' ' test_expect_success 'do not lose modifications in merge (recursive)' '
git reset --hard && git reset --hard &&
git checkout baseline^0 && git checkout baseline^0 &&
echo more content >>a/b/c/d && echo more content >>a/b/c/d &&
test_must_fail git merge -s recursive master test_must_fail git merge -s recursive main
' '
test_expect_success 'setup a merge where dir a/b-2 changed to symlink' ' test_expect_success 'setup a merge where dir a/b-2 changed to symlink' '

View File

@ -2,7 +2,7 @@
test_description='recursive merge corner cases involving criss-cross merges' test_description='recursive merge corner cases involving criss-cross merges'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -388,7 +388,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete' '
test_line_count = 2 out && test_line_count = 2 out &&
git rev-parse >expect \ git rev-parse >expect \
master:file B:file && main:file B:file &&
git rev-parse >actual \ git rev-parse >actual \
:1:file :2:file && :1:file :2:file &&
test_cmp expect actual test_cmp expect actual
@ -410,7 +410,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete, rev
test_line_count = 2 out && test_line_count = 2 out &&
git rev-parse >expect \ git rev-parse >expect \
master:file B:file && main:file B:file &&
git rev-parse >actual \ git rev-parse >actual \
:1:file :3:file && :1:file :3:file &&
test_cmp expect actual test_cmp expect actual
@ -1556,12 +1556,12 @@ test_expect_failure 'check conflicting modes for regular file' '
# Setup: # Setup:
# L1---L2 # L1---L2
# / \ / \ # / \ / \
# master X ? # main X ?
# \ / \ / # \ / \ /
# R1---R2 # R1---R2
# #
# Where: # Where:
# master has two files, named 'b' and 'a' # main has two files, named 'b' and 'a'
# branches L1 and R1 both modify each of the two files in conflicting ways # branches L1 and R1 both modify each of the two files in conflicting ways
# #
# L2 is a merge of R1 into L1; more on it later. # L2 is a merge of R1 into L1; more on it later.
@ -1666,7 +1666,7 @@ test_expect_success 'check nested conflicts' '
cd nested_conflicts && cd nested_conflicts &&
git clean -f && git clean -f &&
MASTER=$(git rev-parse --short master) && MAIN=$(git rev-parse --short main) &&
git checkout L2^0 && git checkout L2^0 &&
# Merge must fail; there is a conflict # Merge must fail; there is a conflict
@ -1682,24 +1682,24 @@ test_expect_success 'check nested conflicts' '
test_line_count = 1 out && test_line_count = 1 out &&
# Create a and b from virtual merge base X # Create a and b from virtual merge base X
git cat-file -p master:a >base && git cat-file -p main:a >base &&
git cat-file -p L1:a >ours && git cat-file -p L1:a >ours &&
git cat-file -p R1:a >theirs && git cat-file -p R1:a >theirs &&
test_must_fail git merge-file --diff3 \ test_must_fail git merge-file --diff3 \
-L "Temporary merge branch 1" \ -L "Temporary merge branch 1" \
-L "$MASTER" \ -L "$MAIN" \
-L "Temporary merge branch 2" \ -L "Temporary merge branch 2" \
ours \ ours \
base \ base \
theirs && theirs &&
sed -e "s/^\([<|=>]\)/\1\1/" ours >vmb_a && sed -e "s/^\([<|=>]\)/\1\1/" ours >vmb_a &&
git cat-file -p master:b >base && git cat-file -p main:b >base &&
git cat-file -p L1:b >ours && git cat-file -p L1:b >ours &&
git cat-file -p R1:b >theirs && git cat-file -p R1:b >theirs &&
test_must_fail git merge-file --diff3 \ test_must_fail git merge-file --diff3 \
-L "Temporary merge branch 1" \ -L "Temporary merge branch 1" \
-L "$MASTER" \ -L "$MAIN" \
-L "Temporary merge branch 2" \ -L "Temporary merge branch 2" \
ours \ ours \
base \ base \
@ -1751,12 +1751,12 @@ test_expect_success 'check nested conflicts' '
# Setup: # Setup:
# L1---L2---L3 # L1---L2---L3
# / \ / \ / \ # / \ / \ / \
# master X1 X2 ? # main X1 X2 ?
# \ / \ / \ / # \ / \ / \ /
# R1---R2---R3 # R1---R2---R3
# #
# Where: # Where:
# master has one file named 'content' # main has one file named 'content'
# branches L1 and R1 both modify each of the two files in conflicting ways # branches L1 and R1 both modify each of the two files in conflicting ways
# #
# L<n> (n>1) is a merge of R<n-1> into L<n-1> # L<n> (n>1) is a merge of R<n-1> into L<n-1>
@ -1837,7 +1837,7 @@ test_expect_success 'check virtual merge base with nested conflicts' '
( (
cd virtual_merge_base_has_nested_conflicts && cd virtual_merge_base_has_nested_conflicts &&
MASTER=$(git rev-parse --short master) && MAIN=$(git rev-parse --short main) &&
git checkout L3^0 && git checkout L3^0 &&
# Merge must fail; there is a conflict # Merge must fail; there is a conflict
@ -1860,13 +1860,13 @@ test_expect_success 'check virtual merge base with nested conflicts' '
# Imitate X1 merge base, except without long enough conflict # Imitate X1 merge base, except without long enough conflict
# markers because a subsequent sed will modify them. Put # markers because a subsequent sed will modify them. Put
# result into vmb. # result into vmb.
git cat-file -p master:content >base && git cat-file -p main:content >base &&
git cat-file -p L:content >left && git cat-file -p L:content >left &&
git cat-file -p R:content >right && git cat-file -p R:content >right &&
cp left merged-once && cp left merged-once &&
test_must_fail git merge-file --diff3 \ test_must_fail git merge-file --diff3 \
-L "Temporary merge branch 1" \ -L "Temporary merge branch 1" \
-L "$MASTER" \ -L "$MAIN" \
-L "Temporary merge branch 2" \ -L "Temporary merge branch 2" \
merged-once \ merged-once \
base \ base \

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
test_description='Merge-recursive ours and theirs variants' test_description='Merge-recursive ours and theirs variants'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -23,11 +23,11 @@ test_expect_success setup '
sed -e "s/9/nueve/" >file <elif && sed -e "s/9/nueve/" >file <elif &&
git commit -a -m theirs && git commit -a -m theirs &&
git checkout master^0 git checkout main^0
' '
test_expect_success 'plain recursive - should conflict' ' test_expect_success 'plain recursive - should conflict' '
git reset --hard master && git reset --hard main &&
test_must_fail git merge -s recursive side && test_must_fail git merge -s recursive side &&
grep nine file && grep nine file &&
grep nueve file && grep nueve file &&
@ -37,7 +37,7 @@ test_expect_success 'plain recursive - should conflict' '
' '
test_expect_success 'recursive favouring theirs' ' test_expect_success 'recursive favouring theirs' '
git reset --hard master && git reset --hard main &&
git merge -s recursive -Xtheirs side && git merge -s recursive -Xtheirs side &&
! grep nine file && ! grep nine file &&
grep nueve file && grep nueve file &&
@ -47,7 +47,7 @@ test_expect_success 'recursive favouring theirs' '
' '
test_expect_success 'recursive favouring ours' ' test_expect_success 'recursive favouring ours' '
git reset --hard master && git reset --hard main &&
git merge -s recursive -X ours side && git merge -s recursive -X ours side &&
grep nine file && grep nine file &&
! grep nueve file && ! grep nueve file &&
@ -59,26 +59,26 @@ test_expect_success 'recursive favouring ours' '
test_expect_success 'binary file with -Xours/-Xtheirs' ' test_expect_success 'binary file with -Xours/-Xtheirs' '
echo file binary >.gitattributes && echo file binary >.gitattributes &&
git reset --hard master && git reset --hard main &&
git merge -s recursive -X theirs side && git merge -s recursive -X theirs side &&
git diff --exit-code side HEAD -- file && git diff --exit-code side HEAD -- file &&
git reset --hard master && git reset --hard main &&
git merge -s recursive -X ours side && 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' ' test_expect_success 'pull passes -X to underlying merge' '
git reset --hard master && git pull -s recursive -Xours . side && git reset --hard main && git pull -s recursive -Xours . side &&
git reset --hard master && git pull -s recursive -X ours . side && git reset --hard main && git pull -s recursive -X ours . side &&
git reset --hard master && git pull -s recursive -Xtheirs . side && git reset --hard main && git pull -s recursive -Xtheirs . side &&
git reset --hard master && git pull -s recursive -X theirs . side && git reset --hard main && 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 && test_must_fail git pull -s recursive -X bork . side
' '
test_expect_success SYMLINKS 'symlink with -Xours/-Xtheirs' ' test_expect_success SYMLINKS 'symlink with -Xours/-Xtheirs' '
git reset --hard master && git reset --hard main &&
git checkout -b two master && git checkout -b two main &&
ln -s target-zero link && ln -s target-zero link &&
git add link && git add link &&
git commit -m "add link pointing to zero" && git commit -m "add link pointing to zero" &&

View File

@ -2,17 +2,17 @@
test_description='CRLF merge conflict across text=auto change test_description='CRLF merge conflict across text=auto change
* [master] remove .gitattributes * [main] remove .gitattributes
! [side] add line from b ! [side] add line from b
-- --
+ [side] add line from b + [side] add line from b
* [master] remove .gitattributes * [main] remove .gitattributes
* [master^] add line from a * [main^] add line from a
* [master~2] normalize file * [main~2] normalize file
*+ [side^] Initial *+ [side^] Initial
' '
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -67,7 +67,7 @@ test_expect_success setup '
git commit -m "add line from b" && git commit -m "add line from b" &&
git tag b && git tag b &&
git checkout master git checkout main
' '
test_expect_success 'set up fuzz_conflict() helper' ' test_expect_success 'set up fuzz_conflict() helper' '
@ -198,7 +198,7 @@ test_expect_success 'Test delete/normalize conflict' '
git reset --hard initial && git reset --hard initial &&
git rm file && git rm file &&
git commit -m "remove file" && git commit -m "remove file" &&
git checkout master && git checkout main &&
git reset --hard a^ && git reset --hard a^ &&
git merge side && git merge side &&
test_path_is_missing file test_path_is_missing file

View File

@ -2,7 +2,7 @@
test_description='git-merge with case-changing rename on case-insensitive file system' test_description='git-merge with case-changing rename on case-insensitive file system'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -23,18 +23,18 @@ test_expect_success 'merge with case-changing rename' '
>foo && >foo &&
git add foo && git add foo &&
git commit -m "intervening commit" && git commit -m "intervening commit" &&
git checkout master && git checkout main &&
git rm TestCase && git rm TestCase &&
>testcase && >testcase &&
git add testcase && git add testcase &&
git commit -m "rename to testcase" && git commit -m "rename to testcase" &&
git checkout with-camel && git checkout with-camel &&
git merge master -m "merge" && git merge main -m "merge" &&
test_path_is_file testcase test_path_is_file testcase
' '
test_expect_success 'merge with case-changing rename on both sides' ' test_expect_success 'merge with case-changing rename on both sides' '
git checkout master && git checkout main &&
git reset --hard baseline && git reset --hard baseline &&
git branch -D with-camel && git branch -D with-camel &&
git checkout -b with-camel && git checkout -b with-camel &&
@ -43,13 +43,13 @@ test_expect_success 'merge with case-changing rename on both sides' '
>foo && >foo &&
git add foo && git add foo &&
git commit -m "intervening commit" && git commit -m "intervening commit" &&
git checkout master && git checkout main &&
git rm TestCase && git rm TestCase &&
>testcase && >testcase &&
git add testcase && git add testcase &&
git commit -m "rename to testcase" && git commit -m "rename to testcase" &&
git checkout with-camel && git checkout with-camel &&
git merge master -m "merge" && git merge main -m "merge" &&
test_path_is_file testcase test_path_is_file testcase
' '

View File

@ -3,7 +3,7 @@
test_description="recursive merge corner cases w/ renames but not criss-crosses" test_description="recursive merge corner cases w/ renames but not criss-crosses"
# t6036 has corner cases that involve both criss-cross merges and renames # t6036 has corner cases that involve both criss-cross merges and renames
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -1133,7 +1133,7 @@ test_conflicts_with_adds_and_renames() {
# Setup: # Setup:
# L # L
# / \ # / \
# master ? # main ?
# \ / # \ /
# R # R
# #
@ -1263,7 +1263,7 @@ test_conflicts_with_adds_and_renames() {
:2:three \ :2:three \
:3:three && :3:three &&
git rev-parse >expected \ git rev-parse >expected \
master:irrelevant_file \ main:irrelevant_file \
file_v2 \ file_v2 \
file_v4 && file_v4 &&
test_cmp expected actual && test_cmp expected actual &&
@ -1293,12 +1293,12 @@ test_conflicts_with_adds_and_renames add add
# Setup: # Setup:
# L # L
# / \ # / \
# master ? # main ?
# \ / # \ /
# R # R
# #
# Where: # Where:
# master has two files, named 'one' and 'two'. # main has two files, named 'one' and 'two'.
# branches L and R both modify 'one', in conflicting ways. # branches L and R both modify 'one', in conflicting ways.
# branches L and R both modify 'two', in conflicting ways. # branches L and R both modify 'two', in conflicting ways.
# branch L also renames 'one' to 'three'. # branch L also renames 'one' to 'three'.
@ -1379,7 +1379,7 @@ test_expect_success 'check nested conflicts from rename/rename(2to1)' '
test_line_count = 1 out && test_line_count = 1 out &&
# Compare :2:three to expected values # Compare :2:three to expected values
git cat-file -p master:one >base && git cat-file -p main:one >base &&
git cat-file -p L:three >ours && git cat-file -p L:three >ours &&
git cat-file -p R:one >theirs && git cat-file -p R:one >theirs &&
test_must_fail git merge-file \ test_must_fail git merge-file \
@ -1390,7 +1390,7 @@ test_expect_success 'check nested conflicts from rename/rename(2to1)' '
test_cmp expect L-three && test_cmp expect L-three &&
# Compare :2:three to expected values # Compare :2:three to expected values
git cat-file -p master:two >base && git cat-file -p main:two >base &&
git cat-file -p L:two >ours && git cat-file -p L:two >ours &&
git cat-file -p R:three >theirs && git cat-file -p R:three >theirs &&
test_must_fail git merge-file \ test_must_fail git merge-file \

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
test_description='Merge-recursive rename/delete conflict message' test_description='Merge-recursive rename/delete conflict message'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -15,7 +15,7 @@ test_expect_success 'rename/delete' '
git mv A B && git mv A B &&
git commit -m "rename" && git commit -m "rename" &&
git checkout master && git checkout main &&
git rm A && git rm A &&
git commit -m "delete" && git commit -m "delete" &&

View File

@ -2,7 +2,7 @@
test_description='recursive merge diff3 style conflict markers' test_description='recursive merge diff3 style conflict markers'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -46,7 +46,7 @@ test_expect_success 'check no merge base' '
# Setup: # Setup:
# L1 # L1
# / \ # / \
# master ? # main ?
# \ / # \ /
# R1 # R1
# #
@ -93,18 +93,18 @@ test_expect_success 'check unique merge base' '
cd unique_merge_base && cd unique_merge_base &&
git checkout L^0 && git checkout L^0 &&
MASTER=$(git rev-parse --short master) && MAIN=$(git rev-parse --short main) &&
test_must_fail git -c merge.conflictstyle=diff3 merge -s recursive R^0 && test_must_fail git -c merge.conflictstyle=diff3 merge -s recursive R^0 &&
grep "|||||| $MASTER:content" renamed grep "|||||| $MAIN:content" renamed
) )
' '
# Setup: # Setup:
# L1---L2--L3 # L1---L2--L3
# / \ / \ # / \ / \
# master X1 ? # main X1 ?
# \ / \ / # \ / \ /
# R1---R2--R3 # R1---R2--R3
# #
@ -194,10 +194,10 @@ test_expect_success 'rebase --merge describes parent of commit being picked' '
( (
cd rebase && cd rebase &&
test_commit base file && test_commit base file &&
test_commit master file && test_commit main file &&
git checkout -b side HEAD^ && git checkout -b side HEAD^ &&
test_commit side file && test_commit side file &&
test_must_fail git -c merge.conflictstyle=diff3 rebase --merge master && test_must_fail git -c merge.conflictstyle=diff3 rebase --merge main &&
grep "||||||| parent of" file grep "||||||| parent of" file
) )
' '
@ -206,7 +206,7 @@ test_expect_success 'rebase --apply describes fake ancestor base' '
( (
cd rebase && cd rebase &&
git rebase --abort && git rebase --abort &&
test_must_fail git -c merge.conflictstyle=diff3 rebase --apply master && test_must_fail git -c merge.conflictstyle=diff3 rebase --apply main &&
grep "||||||| constructed merge base" file grep "||||||| constructed merge base" file
) )
' '

View File

@ -2,7 +2,7 @@
test_description='merge-recursive backend test' test_description='merge-recursive backend test'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -38,7 +38,7 @@ test_expect_success 'setup 1' '
git add a d/e && git add a d/e &&
test_tick && test_tick &&
git commit -m "master modifies a and d/e" && git commit -m "main modifies a and d/e" &&
c1=$(git rev-parse --verify HEAD) && c1=$(git rev-parse --verify HEAD) &&
( git ls-tree -r HEAD && git ls-files -s ) >actual && ( git ls-tree -r HEAD && git ls-files -s ) >actual &&
( (
@ -469,7 +469,7 @@ test_expect_success SYMLINKS 'dir in working tree with symlink ancestor does not
git checkout -b branch1 && git checkout -b branch1 &&
git commit --allow-empty -m "empty commit" && git commit --allow-empty -m "empty commit" &&
git checkout master && git checkout main &&
git rm foo && git rm foo &&
mkdir foo && mkdir foo &&
>foo/bar && >foo/bar &&
@ -478,7 +478,7 @@ test_expect_success SYMLINKS 'dir in working tree with symlink ancestor does not
git checkout branch1 && git checkout branch1 &&
git cherry-pick master && git cherry-pick main &&
test_path_is_dir foo && test_path_is_dir foo &&
test_path_is_file foo/bar test_path_is_file foo/bar
) )
@ -493,8 +493,8 @@ test_expect_success 'reset and 3-way merge' '
test_expect_success 'reset and bind merge' ' test_expect_success 'reset and bind merge' '
git reset --hard master && git reset --hard main &&
git read-tree --prefix=M/ master && git read-tree --prefix=M/ main &&
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o1 0 M/a" && echo "100644 $o1 0 M/a" &&
@ -508,7 +508,7 @@ test_expect_success 'reset and bind merge' '
) >expected && ) >expected &&
test_cmp expected actual && test_cmp expected actual &&
git read-tree --prefix=a1/ master && git read-tree --prefix=a1/ main &&
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o1 0 M/a" && echo "100644 $o1 0 M/a" &&
@ -526,7 +526,7 @@ test_expect_success 'reset and bind merge' '
) >expected && ) >expected &&
test_cmp expected actual && test_cmp expected actual &&
git read-tree --prefix=z/ master && git read-tree --prefix=z/ main &&
git ls-files -s >actual && git ls-files -s >actual &&
( (
echo "100644 $o1 0 M/a" && echo "100644 $o1 0 M/a" &&
@ -602,11 +602,11 @@ test_expect_success 'merge-recursive w/ empty work tree - theirs has rename' '
test_expect_success 'merge removes empty directories' ' test_expect_success 'merge removes empty directories' '
git reset --hard master && git reset --hard main &&
git checkout -b rm && git checkout -b rm &&
git rm d/e && git rm d/e &&
git commit -mremoved-d/e && git commit -mremoved-d/e &&
git checkout master && git checkout main &&
git merge -s recursive rm && git merge -s recursive rm &&
test_path_is_missing d test_path_is_missing d
' '

View File

@ -2,16 +2,16 @@
test_description='merge-recursive space options test_description='merge-recursive space options
* [master] Clarify * [main] Clarify
! [remote] Remove cruft ! [remote] Remove cruft
-- --
+ [remote] Remove cruft + [remote] Remove cruft
* [master] Clarify * [main] Clarify
*+ [remote^] Initial revision *+ [remote^] Initial revision
* ok 1: setup * ok 1: setup
' '
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -90,7 +90,7 @@ test_expect_success 'setup' '
mv text.txt+ text.txt && mv text.txt+ text.txt &&
git commit -a -m "Remove cruft" && git commit -a -m "Remove cruft" &&
git checkout master && git checkout main &&
sed -e " sed -e "
s/\(not in his right mind\),\(.*\)/\1;\2Q/ s/\(not in his right mind\),\(.*\)/\1;\2Q/
s/Quite correct\(.*\)/It is too correct\1Q/ s/Quite correct\(.*\)/It is too correct\1Q/

View File

@ -2,13 +2,13 @@
test_description='"git merge" top-level frontend' test_description='"git merge" top-level frontend'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
t3033_reset () { t3033_reset () {
git checkout -B master two && git checkout -B main two &&
git branch -f left three && git branch -f left three &&
git branch -f right four git branch -f right four
} }
@ -24,7 +24,7 @@ test_expect_success setup '
test_commit four && test_commit four &&
git checkout --orphan newroot && git checkout --orphan newroot &&
test_commit five && test_commit five &&
git checkout master git checkout main
' '
# Local branches # Local branches
@ -64,7 +64,7 @@ test_expect_success 'merge octopus, non-fast-forward (ff)' '
test_expect_success 'merge octopus, fast-forward (does not ff)' ' test_expect_success 'merge octopus, fast-forward (does not ff)' '
t3033_reset && t3033_reset &&
git merge left right && git merge left right &&
# two (master) is not an ancestor of three (left) and four (right) # two (main) is not an ancestor of three (left) and four (right)
test_must_fail git rev-parse --verify HEAD^4 && test_must_fail git rev-parse --verify HEAD^4 &&
git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual && git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual &&
git rev-parse two three four | sort >expect && git rev-parse two three four | sort >expect &&
@ -121,7 +121,7 @@ test_expect_success 'merge FETCH_HEAD octopus fast-forward (does not ff)' '
t3033_reset && t3033_reset &&
git fetch . left right && git fetch . left right &&
git merge FETCH_HEAD && git merge FETCH_HEAD &&
# two (master) is not an ancestor of three (left) and four (right) # two (main) is not an ancestor of three (left) and four (right)
test_must_fail git rev-parse --verify HEAD^4 && test_must_fail git rev-parse --verify HEAD^4 &&
git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual && git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual &&
git rev-parse two three four | sort >expect && git rev-parse two three four | sort >expect &&

View File

@ -5,11 +5,11 @@ test_description='merge-recursive rename options
Test rename detection by examining rename/delete conflicts. Test rename detection by examining rename/delete conflicts.
* (HEAD -> rename) rename * (HEAD -> rename) rename
| * (master) delete | * (main) delete
|/ |/
* base * base
git diff --name-status base master git diff --name-status base main
D 0-old D 0-old
D 1-old D 1-old
D 2-old D 2-old
@ -26,7 +26,7 @@ they are rounded down (see, e.g., Documentation/diff-generate-patch.txt, which
mentions this in a different context). mentions this in a different context).
' '
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -121,7 +121,7 @@ test_expect_success 'setup repo' '
get_expected_stages 2 && get_expected_stages 2 &&
get_expected_stages 3 && get_expected_stages 3 &&
check_50="false" && check_50="false" &&
tail="HEAD^ -- HEAD master" tail="HEAD^ -- HEAD main"
' '
test_expect_success 'setup thresholds' ' test_expect_success 'setup thresholds' '

View File

@ -4,7 +4,7 @@ test_description='git-merge
Do not overwrite changes.' Do not overwrite changes.'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -196,7 +196,7 @@ test_expect_success 'set up unborn branch and content' '
' '
test_expect_success 'will not clobber WT/index when merging into unborn' ' test_expect_success 'will not clobber WT/index when merging into unborn' '
git merge master && git merge main &&
grep foo tracked-file && grep foo tracked-file &&
git show :tracked-file >expect && git show :tracked-file >expect &&
grep foo expect && grep foo expect &&

View File

@ -2,7 +2,7 @@
test_description='merging with submodules' test_description='merging with submodules'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -30,7 +30,7 @@ test_expect_success setup '
test_tick && test_tick &&
git commit -m root && git commit -m root &&
git checkout -b a master && git checkout -b a main &&
(cd sub && (cd sub &&
echo A > file && echo A > file &&
git add file && git add file &&
@ -40,7 +40,7 @@ test_expect_success setup '
test_tick && test_tick &&
git commit -m a && git commit -m a &&
git checkout -b b master && git checkout -b b main &&
(cd sub && (cd sub &&
echo B > file && echo B > file &&
git add file && git add file &&
@ -257,22 +257,22 @@ test_expect_success 'setup for recursive merge with submodule' '
(cd sub && (cd sub &&
git init && git init &&
test_commit a && test_commit a &&
git checkout -b sub-b master && git checkout -b sub-b main &&
test_commit b && test_commit b &&
git checkout -b sub-c master && git checkout -b sub-c main &&
test_commit c && test_commit c &&
git checkout -b sub-bc sub-b && git checkout -b sub-bc sub-b &&
git merge sub-c && git merge sub-c &&
git checkout -b sub-cb sub-c && git checkout -b sub-cb sub-c &&
git merge sub-b && git merge sub-b &&
git checkout master) && git checkout main) &&
git add sub && git add sub &&
git commit -m a && git commit -m a &&
git checkout -b top-b master && git checkout -b top-b main &&
(cd sub && git checkout sub-b) && (cd sub && git checkout sub-b) &&
git add sub && git add sub &&
git commit -m b && git commit -m b &&
git checkout -b top-c master && git checkout -b top-c main &&
(cd sub && git checkout sub-c) && (cd sub && git checkout sub-c) &&
git add sub && git add sub &&
git commit -m c && git commit -m c &&

View File

@ -2,7 +2,7 @@
test_description='unpack-trees error messages' test_description='unpack-trees error messages'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -21,7 +21,7 @@ test_expect_success 'setup' '
git add two three four five && git add two three four five &&
git commit -m Second && git commit -m Second &&
git checkout master && git checkout main &&
echo other >two && echo other >two &&
echo other >three && echo other >three &&
echo other >four && echo other >four &&
@ -86,7 +86,7 @@ test_expect_success 'cannot switch branches because of local changes' '
echo two >rep/two && echo two >rep/two &&
git add rep/one rep/two && git add rep/one rep/two &&
git commit -m Fourth && git commit -m Fourth &&
git checkout master && git checkout main &&
echo uno >rep/one && echo uno >rep/one &&
echo dos >rep/two && echo dos >rep/two &&
test_must_fail git checkout branch 2>out && test_must_fail git checkout branch 2>out &&
@ -131,7 +131,7 @@ test_expect_success 'not_uptodate_dir porcelain checkout error' '
>rep2 && >rep2 &&
git add rep rep2 && git add rep rep2 &&
git commit -m "added test as a file" && git commit -m "added test as a file" &&
git checkout master && git checkout main &&
>rep/untracked-file && >rep/untracked-file &&
>rep2/untracked-file && >rep2/untracked-file &&
test_must_fail git checkout branch 2>out && test_must_fail git checkout branch 2>out &&

View File

@ -25,7 +25,7 @@
# to refer to an existing tree). # to refer to an existing tree).
test_description='check pruning of dependent objects' test_description='check pruning of dependent objects'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh . ./test-lib.sh
@ -70,7 +70,7 @@ for repack in '' true; do
git checkout -b experiment && git checkout -b experiment &&
commit abandon && commit abandon &&
maybe_repack && maybe_repack &&
git checkout master && git checkout main &&
git branch -D experiment git branch -D experiment
' '