summaryrefslogtreecommitdiff
path: root/t/t6402-merge-rename.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2020-11-18 23:44:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-11-19 23:44:18 (GMT)
commit5902f5f4608c1857fc04dcae2a0ce6beea31c8f8 (patch)
tree9a56000f293ef84871a419a00bb7a3abdcda6706 /t/t6402-merge-rename.sh
parent1f53df54eba378eee544b47f7c9e7f5fc32873e1 (diff)
downloadgit-5902f5f4608c1857fc04dcae2a0ce6beea31c8f8.zip
git-5902f5f4608c1857fc04dcae2a0ce6beea31c8f8.tar.gz
git-5902f5f4608c1857fc04dcae2a0ce6beea31c8f8.tar.bz2
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>
Diffstat (limited to 't/t6402-merge-rename.sh')
-rwxr-xr-xt/t6402-merge-rename.sh48
1 files changed, 24 insertions, 24 deletions
diff --git a/t/t6402-merge-rename.sh b/t/t6402-merge-rename.sh
index 227c2fe..425dad9 100755
--- a/t/t6402-merge-rename.sh
+++ b/t/t6402-merge-rename.sh
@@ -1,7 +1,7 @@
#!/bin/sh
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
. ./test-lib.sh
@@ -57,9 +57,9 @@ test_expect_success 'setup' '
git branch change &&
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 &&
- git commit -a -m "master updates A" &&
+ git commit -a -m "main updates A" &&
git checkout yellow &&
rm -f M &&
@@ -97,7 +97,7 @@ test_expect_success 'setup' '
git update-index --add B &&
git commit -q -a -m "changed and renamed" &&
- git checkout master
+ git checkout main
'
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/{
p
q
- }" B | grep master &&
+ }" B | grep main &&
git diff --exit-code white N
'
@@ -137,7 +137,7 @@ test_expect_success 'pull unrenaming branch into renaming one' \
'
git reset --hard &&
git show-branch &&
- test_expect_code 1 git pull . master &&
+ test_expect_code 1 git pull . main &&
git ls-files -u B >b.stages &&
test_line_count = 3 b.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' '
git reset --hard &&
rm -f A M &&
- git checkout -f master &&
+ git checkout -f main &&
git tag -f anchor &&
git show-branch &&
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' '
git reset --hard &&
rm -f A M &&
- git checkout -f master &&
+ git checkout -f main &&
git tag -f anchor &&
git show-branch &&
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' '
git reset --hard &&
rm -f A M &&
- git checkout -f master &&
+ git checkout -f main &&
git tag -f anchor &&
git show-branch &&
echo >>M one line addition &&
@@ -232,7 +232,7 @@ test_expect_success 'interference with untracked working tree file' '
git tag -f anchor &&
git show-branch &&
echo >M this file should not matter &&
- git pull . master &&
+ git pull . main &&
test_path_is_file M &&
! {
git ls-files -s |
@@ -767,7 +767,7 @@ test_expect_success 'setup avoid unnecessary update, dir->(file,nothing)' '
git rm -rf df &&
git commit -mB &&
- git checkout master &&
+ git checkout main &&
git rm -rf df &&
echo bla >df &&
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)' '
- git checkout -q master^0 &&
+ git checkout -q main^0 &&
test-tool chmtime --get -3600 df >expect &&
git merge side &&
test-tool chmtime --get df >actual &&
@@ -797,14 +797,14 @@ test_expect_success 'setup avoid unnecessary update, modify/delete' '
git rm -f file &&
git commit -m "Delete file" &&
- git checkout master &&
+ git checkout main &&
echo bla >file &&
git add -A &&
git commit -m "Modify file"
'
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_must_fail git merge side &&
test-tool chmtime --get file >actual &&
@@ -826,13 +826,13 @@ test_expect_success 'setup avoid unnecessary update, rename/add-dest' '
git add -A &&
git commit -m "Add file copy" &&
- git checkout master &&
+ git checkout main &&
git mv file newfile &&
git commit -m "Rename file"
'
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 &&
git merge side &&
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 commit -mB &&
- git checkout master &&
+ git checkout main &&
echo 8.5 >>original_file &&
git add original_file &&
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 &&
- test_must_fail git merge -s recursive master^0 &&
+ test_must_fail git merge -s recursive main^0 &&
cat >expected <<-\EOF &&
1
@@ -905,14 +905,14 @@ test_expect_success 'merge master into rename has correct extended markers' '
9
=======
8.5
- >>>>>>> master^0:original_file
+ >>>>>>> main^0:original_file
EOF
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 checkout master^0 &&
+ git checkout main^0 &&
test_must_fail git merge -s recursive rename^0 &&
cat >expected <<-\EOF &&
@@ -948,13 +948,13 @@ test_expect_success 'setup spurious "refusing to lose untracked" message' '
git mv original_file renamed_file &&
git commit -mB &&
- git checkout master &&
+ git checkout main &&
git rm original_file &&
git commit -mC
'
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 &&
! grep "refusing to lose untracked file" errors.txt
'