diff options
Diffstat (limited to 't/t5801-remote-helpers.sh')
-rwxr-xr-x | t/t5801-remote-helpers.sh | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh index 121e5c6edb..d386076dbd 100755 --- a/t/t5801-remote-helpers.sh +++ b/t/t5801-remote-helpers.sh @@ -5,15 +5,24 @@ test_description='Test remote-helper import and export commands' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh . "$TEST_DIRECTORY"/lib-gpg.sh PATH="$TEST_DIRECTORY/t5801:$PATH" compare_refs() { + fail= && + if test "x$1" = 'x!' + then + fail='!' && + shift + fi && git --git-dir="$1/.git" rev-parse --verify $2 >expect && git --git-dir="$3/.git" rev-parse --verify $4 >actual && - test_cmp expect actual + eval $fail test_cmp expect actual } test_expect_success 'setup repository' ' @@ -65,18 +74,18 @@ test_expect_success 'fetch multiple branches' ' (cd local && git fetch ) && - compare_refs server master local refs/remotes/origin/master && + compare_refs server main local refs/remotes/origin/main && compare_refs server new local refs/remotes/origin/new ' test_expect_success 'push when remote has extra refs' ' (cd local && - git reset --hard origin/master && + git reset --hard origin/main && echo content >>file && git commit -a -m six && git push ) && - compare_refs local master server master + compare_refs local main server main ' test_expect_success 'push new branch by name' ' @@ -168,7 +177,7 @@ test_expect_failure 'pushing without marks' ' test_expect_success 'push all with existing object' ' (cd local && - git branch dup2 master && + git branch dup2 main && git push origin --all ) && compare_refs local dup2 server dup2 @@ -176,7 +185,7 @@ test_expect_success 'push all with existing object' ' test_expect_success 'push ref with existing object' ' (cd local && - git branch dup master && + git branch dup main && git push origin dup ) && compare_refs local dup server dup @@ -184,17 +193,17 @@ test_expect_success 'push ref with existing object' ' test_expect_success GPG 'push signed tag' ' (cd local && - git checkout master && + git checkout main && git tag -s -m signed-tag signed-tag && git push origin signed-tag ) && compare_refs local signed-tag^{} server signed-tag^{} && - test_must_fail compare_refs local signed-tag server signed-tag + compare_refs ! local signed-tag server signed-tag ' test_expect_success GPG 'push signed tag with signed-tags capability' ' (cd local && - git checkout master && + git checkout main && git tag -s -m signed-tag signed-tag-2 && GIT_REMOTE_TESTGIT_SIGNED_TAGS=1 git push origin signed-tag-2 ) && @@ -203,7 +212,7 @@ test_expect_success GPG 'push signed tag with signed-tags capability' ' test_expect_success 'push update refs' ' (cd local && - git checkout -b update master && + git checkout -b update main && echo update >>file && git commit -a -m update && git push origin update && @@ -254,7 +263,7 @@ test_expect_success 'proper failure checks for fetching' ' test_expect_success 'proper failure checks for pushing' ' test_when_finished "rm -rf local/git.marks local/testgit.marks" && (cd local && - git checkout -b crash master && + git checkout -b crash main && echo crash >>file && git commit -a -m crash && test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git push --all && @@ -266,7 +275,7 @@ test_expect_success 'proper failure checks for pushing' ' test_expect_success 'push messages' ' (cd local && - git checkout -b new_branch master && + git checkout -b new_branch main && echo new >>file && git commit -a -m new && git push origin new_branch && @@ -280,7 +289,7 @@ test_expect_success 'push messages' ' test_expect_success 'fetch HEAD' ' (cd server && - git checkout master && + git checkout main && echo more >>file && git commit -a -m more ) && @@ -292,7 +301,7 @@ test_expect_success 'fetch HEAD' ' test_expect_success 'fetch url' ' (cd server && - git checkout master && + git checkout main && echo more >>file && git commit -a -m more ) && |