From 028cb644ec6450fa9438ba6b6d100c0f34e029a5 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 18 Nov 2020 23:44:34 +0000 Subject: t55[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' -e 's/retsam/niam/g' \ -- t55[4-9]*.sh t556x*) This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main` for those tests. Note that t5541 uses the reversed `master` name: `retsam`. We replace it by the equivalent for `main`: `niam`. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- t/t5545-push-options.sh | 64 ++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 't/t5545-push-options.sh') diff --git a/t/t5545-push-options.sh b/t/t5545-push-options.sh index 202d75aebe..58c7add7ee 100755 --- a/t/t5545-push-options.sh +++ b/t/t5545-push-options.sh @@ -2,7 +2,7 @@ test_description='pushing to a repository using push options' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -66,9 +66,9 @@ test_expect_success 'one push option works for a single branch' ' test_commit one && git push --mirror up && test_commit two && - git push --push-option=asdf up master + git push --push-option=asdf up main ) && - test_refs master master && + test_refs main main && echo "asdf" >expect && test_cmp expect upstream/.git/hooks/pre-receive.push_options && test_cmp expect upstream/.git/hooks/post-receive.push_options @@ -82,9 +82,9 @@ test_expect_success 'push option denied by remote' ' test_commit one && git push --mirror up && test_commit two && - test_must_fail git push --push-option=asdf up master + test_must_fail git push --push-option=asdf up main ) && - test_refs master HEAD@{1} + test_refs main HEAD@{1} ' test_expect_success 'two push options work' ' @@ -95,9 +95,9 @@ test_expect_success 'two push options work' ' test_commit one && git push --mirror up && test_commit two && - git push --push-option=asdf --push-option="more structured text" up master + git push --push-option=asdf --push-option="more structured text" up main ) && - test_refs master master && + test_refs main main && printf "asdf\nmore structured text\n" >expect && test_cmp expect upstream/.git/hooks/pre-receive.push_options && test_cmp expect upstream/.git/hooks/post-receive.push_options @@ -126,14 +126,14 @@ test_expect_success 'push options and submodules' ' git -C parent push \ --push-option=asdf --push-option="more structured text" \ - --recurse-submodules=on-demand up master && + --recurse-submodules=on-demand up main && - git -C upstream rev-parse --verify master >expect && - git -C parent/workbench rev-parse --verify master >actual && + git -C upstream rev-parse --verify main >expect && + git -C parent/workbench rev-parse --verify main >actual && test_cmp expect actual && - git -C parent_upstream rev-parse --verify master >expect && - git -C parent rev-parse --verify master >actual && + git -C parent_upstream rev-parse --verify main >expect && + git -C parent rev-parse --verify main >actual && test_cmp expect actual && printf "asdf\nmore structured text\n" >expect && @@ -151,9 +151,9 @@ test_expect_success 'default push option' ' test_commit one && git push --mirror up && test_commit two && - git -c push.pushOption=default push up master + git -c push.pushOption=default push up main ) && - test_refs master master && + test_refs main main && echo "default" >expect && test_cmp expect upstream/.git/hooks/pre-receive.push_options && test_cmp expect upstream/.git/hooks/post-receive.push_options @@ -167,9 +167,9 @@ test_expect_success 'two default push options' ' test_commit one && git push --mirror up && test_commit two && - git -c push.pushOption=default1 -c push.pushOption=default2 push up master + git -c push.pushOption=default1 -c push.pushOption=default2 push up main ) && - test_refs master master && + test_refs main main && printf "default1\ndefault2\n" >expect && test_cmp expect upstream/.git/hooks/pre-receive.push_options && test_cmp expect upstream/.git/hooks/post-receive.push_options @@ -183,9 +183,9 @@ test_expect_success 'push option from command line overrides from-config push op test_commit one && git push --mirror up && test_commit two && - git -c push.pushOption=default push --push-option=manual up master + git -c push.pushOption=default push --push-option=manual up main ) && - test_refs master master && + test_refs main main && echo "manual" >expect && test_cmp expect upstream/.git/hooks/pre-receive.push_options && test_cmp expect upstream/.git/hooks/post-receive.push_options @@ -199,9 +199,9 @@ test_expect_success 'empty value of push.pushOption in config clears the list' ' test_commit one && git push --mirror up && test_commit two && - git -c push.pushOption=default1 -c push.pushOption= -c push.pushOption=default2 push up master + git -c push.pushOption=default1 -c push.pushOption= -c push.pushOption=default2 push up main ) && - test_refs master master && + test_refs main main && echo "default2" >expect && test_cmp expect upstream/.git/hooks/pre-receive.push_options && test_cmp expect upstream/.git/hooks/post-receive.push_options @@ -215,16 +215,16 @@ test_expect_success 'invalid push option in config' ' test_commit one && git push --mirror up && test_commit two && - test_must_fail git -c push.pushOption push up master + test_must_fail git -c push.pushOption push up main ) && - test_refs master HEAD@{1} + test_refs main HEAD@{1} ' test_expect_success 'push options keep quoted characters intact (direct)' ' mk_repo_pair && git -C upstream config receive.advertisePushOptions true && test_commit -C workbench one && - git -C workbench push --push-option="\"embedded quotes\"" up master && + git -C workbench push --push-option="\"embedded quotes\"" up main && echo "\"embedded quotes\"" >expect && test_cmp expect upstream/.git/hooks/pre-receive.push_options ' @@ -247,28 +247,28 @@ mk_http_pair () { test_expect_success 'push option denied properly by http server' ' mk_http_pair false && test_commit -C test_http_clone one && - test_must_fail git -C test_http_clone push --push-option=asdf origin master 2>actual && + test_must_fail git -C test_http_clone push --push-option=asdf origin main 2>actual && test_i18ngrep "the receiving end does not support push options" actual && - git -C test_http_clone push origin master + git -C test_http_clone push origin main ' test_expect_success 'push options work properly across http' ' mk_http_pair true && test_commit -C test_http_clone one && - git -C test_http_clone push origin master && - git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify master >expect && - git -C test_http_clone rev-parse --verify master >actual && + git -C test_http_clone push origin main && + git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify main >expect && + git -C test_http_clone rev-parse --verify main >actual && test_cmp expect actual && test_commit -C test_http_clone two && - git -C test_http_clone push --push-option=asdf --push-option="more structured text" origin master && + git -C test_http_clone push --push-option=asdf --push-option="more structured text" origin main && printf "asdf\nmore structured text\n" >expect && test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/pre-receive.push_options && test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/post-receive.push_options && - git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify master >expect && - git -C test_http_clone rev-parse --verify master >actual && + git -C "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git rev-parse --verify main >expect && + git -C test_http_clone rev-parse --verify main >actual && test_cmp expect actual ' @@ -276,7 +276,7 @@ test_expect_success 'push options keep quoted characters intact (http)' ' mk_http_pair true && test_commit -C test_http_clone one && - git -C test_http_clone push --push-option="\"embedded quotes\"" origin master && + git -C test_http_clone push --push-option="\"embedded quotes\"" origin main && echo "\"embedded quotes\"" >expect && test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH"/upstream.git/hooks/pre-receive.push_options ' -- cgit v1.2.3