]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5520-pull.sh
Merge branch 'jt/trace2-BUG'
[thirdparty/git.git] / t / t5520-pull.sh
index 9fae07cdfafab1a05354dfd41df3a5cf5cb3ce58..a09411327f9a794009b5791786807ee5b43d6434 100755 (executable)
@@ -2,6 +2,9 @@
 
 test_description='pulling into void'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 modify () {
@@ -48,11 +51,11 @@ test_expect_success 'pulling into void' '
        test_cmp file cloned/file
 '
 
-test_expect_success 'pulling into void using master:master' '
+test_expect_success 'pulling into void using main:main' '
        git init cloned-uho &&
        (
                cd cloned-uho &&
-               git pull .. master:master
+               git pull .. main:main
        ) &&
        test_path_is_file file &&
        test_path_is_file cloned-uho/file &&
@@ -64,7 +67,7 @@ test_expect_success 'pulling into void does not overwrite untracked files' '
        (
                cd cloned-untracked &&
                echo untracked >file &&
-               test_must_fail git pull .. master &&
+               test_must_fail git pull .. main &&
                echo untracked >expect &&
                test_cmp expect file
        )
@@ -76,7 +79,7 @@ test_expect_success 'pulling into void does not overwrite staged files' '
                cd cloned-staged-colliding &&
                echo "alternate content" >file &&
                git add file &&
-               test_must_fail git pull .. master &&
+               test_must_fail git pull .. main &&
                echo "alternate content" >expect &&
                test_cmp expect file &&
                git cat-file blob :file >file.index &&
@@ -90,7 +93,7 @@ test_expect_success 'pulling into void does not remove new staged files' '
                cd cloned-staged-new &&
                echo "new tracked file" >newfile &&
                git add newfile &&
-               git pull .. master &&
+               git pull .. main &&
                echo "new tracked file" >expect &&
                test_cmp expect newfile &&
                git cat-file blob :newfile >newfile.index &&
@@ -102,15 +105,15 @@ test_expect_success 'pulling into void must not create an octopus' '
        git init cloned-octopus &&
        (
                cd cloned-octopus &&
-               test_must_fail git pull .. master master &&
+               test_must_fail git pull .. main main &&
                test_path_is_missing file
        )
 '
 
 test_expect_success 'test . as a remote' '
-       git branch copy master &&
+       git branch copy main &&
        git config branch.copy.remote . &&
-       git config branch.copy.merge refs/heads/master &&
+       git config branch.copy.merge refs/heads/main &&
        echo updated >file &&
        git commit -a -m updated &&
        git checkout copy &&
@@ -126,7 +129,7 @@ test_expect_success 'test . as a remote' '
 '
 
 test_expect_success 'the default remote . should not break explicit pull' '
-       git checkout -b second master^ &&
+       git checkout -b second main^ &&
        echo modified >file &&
        git commit -a -m modified &&
        git checkout copy &&
@@ -361,7 +364,7 @@ test_expect_success 'failed --rebase shows advice' '
 
 test_expect_success '--rebase fails with multiple branches' '
        git reset --hard before-rebase &&
-       test_must_fail git pull --rebase . copy master 2>err &&
+       test_must_fail git pull --rebase . copy main 2>err &&
        test_cmp_rev HEAD before-rebase &&
        test_i18ngrep "Cannot rebase onto multiple branches" err &&
        echo modified >expect &&
@@ -500,7 +503,7 @@ test_expect_success 'pull --rebase does not warn on --no-verify-signatures' '
        test_i18ngrep ! "verify-signatures" err
 '
 
-# add a feature branch, keep-merge, that is merged into master, so the
+# add a feature branch, keep-merge, that is merged into main, so the
 # test can try preserving the merge commit (or not) with various
 # --rebase flags/pull.rebase settings.
 test_expect_success 'preserve merge setup' '
@@ -699,12 +702,12 @@ test_expect_success 'pull --rebase dies early with dirty working directory' '
 '
 
 test_expect_success 'pull --rebase works on branch yet to be born' '
-       git rev-parse master >expect &&
+       git rev-parse main >expect &&
        mkdir empty_repo &&
        (
                cd empty_repo &&
                git init &&
-               git pull --rebase .. master &&
+               git pull --rebase .. main &&
                git rev-parse HEAD >../actual
        ) &&
        test_cmp expect actual
@@ -720,7 +723,7 @@ test_expect_success 'pull --rebase fails on unborn branch with staged changes' '
                echo staged-file >expect &&
                git ls-files >actual &&
                test_cmp expect actual &&
-               test_must_fail git pull --rebase .. master 2>err &&
+               test_must_fail git pull --rebase .. main 2>err &&
                git ls-files >actual &&
                test_cmp expect actual &&
                git show :staged-file >actual &&
@@ -779,7 +782,7 @@ test_expect_success 'setup for avoiding reapplying old patches' '
        (
                cd dst &&
                test_might_fail git rebase --abort &&
-               git reset --hard origin/master
+               git reset --hard origin/main
        ) &&
        git clone --bare src src-replace.git &&
        rm -rf src &&