diff options
Diffstat (limited to 't/t3201-branch-contains.sh')
-rwxr-xr-x | t/t3201-branch-contains.sh | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh index 532cdbe..8e626af 100755 --- a/t/t3201-branch-contains.sh +++ b/t/t3201-branch-contains.sh @@ -2,7 +2,7 @@ test_description='branch --contains <commit>, --no-contains <commit> --merged, and --no-merged' -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh @@ -17,47 +17,47 @@ test_expect_success setup ' echo 1 >file && test_tick && - git commit -a -m "second on master" && + git commit -a -m "second on main" && git checkout side && echo 1 >file && test_tick && git commit -a -m "second on side" && - git merge master + git merge main ' -test_expect_success 'branch --contains=master' ' +test_expect_success 'branch --contains=main' ' - git branch --contains=master >actual && + git branch --contains=main >actual && { - echo " master" && echo "* side" + echo " main" && echo "* side" } >expect && test_cmp expect actual ' -test_expect_success 'branch --contains master' ' +test_expect_success 'branch --contains main' ' - git branch --contains master >actual && + git branch --contains main >actual && { - echo " master" && echo "* side" + echo " main" && echo "* side" } >expect && test_cmp expect actual ' -test_expect_success 'branch --no-contains=master' ' +test_expect_success 'branch --no-contains=main' ' - git branch --no-contains=master >actual && + git branch --no-contains=main >actual && test_must_be_empty actual ' -test_expect_success 'branch --no-contains master' ' +test_expect_success 'branch --no-contains main' ' - git branch --no-contains master >actual && + git branch --no-contains main >actual && test_must_be_empty actual ' @@ -76,7 +76,7 @@ test_expect_success 'branch --no-contains=side' ' git branch --no-contains=side >actual && { - echo " master" + echo " main" } >expect && test_cmp expect actual @@ -84,9 +84,9 @@ test_expect_success 'branch --no-contains=side' ' test_expect_success 'branch --contains with pattern implies --list' ' - git branch --contains=master master >actual && + git branch --contains=main main >actual && { - echo " master" + echo " main" } >expect && test_cmp expect actual @@ -94,7 +94,7 @@ test_expect_success 'branch --contains with pattern implies --list' ' test_expect_success 'branch --no-contains with pattern implies --list' ' - git branch --no-contains=master master >actual && + git branch --no-contains=main main >actual && test_must_be_empty actual ' @@ -103,7 +103,7 @@ test_expect_success 'side: branch --merged' ' git branch --merged >actual && { - echo " master" && + echo " main" && echo "* side" } >expect && test_cmp expect actual @@ -112,9 +112,9 @@ test_expect_success 'side: branch --merged' ' test_expect_success 'branch --merged with pattern implies --list' ' - git branch --merged=side master >actual && + git branch --merged=side main >actual && { - echo " master" + echo " main" } >expect && test_cmp expect actual @@ -127,18 +127,18 @@ test_expect_success 'side: branch --no-merged' ' ' -test_expect_success 'master: branch --merged' ' +test_expect_success 'main: branch --merged' ' - git checkout master && + git checkout main && git branch --merged >actual && { - echo "* master" + echo "* main" } >expect && test_cmp expect actual ' -test_expect_success 'master: branch --no-merged' ' +test_expect_success 'main: branch --no-merged' ' git branch --no-merged >actual && { @@ -150,22 +150,22 @@ test_expect_success 'master: branch --no-merged' ' test_expect_success 'branch --no-merged with pattern implies --list' ' - git branch --no-merged=master master >actual && + git branch --no-merged=main main >actual && test_must_be_empty actual ' test_expect_success 'implicit --list conflicts with modification options' ' - test_must_fail git branch --contains=master -d && - test_must_fail git branch --contains=master -m foo && - test_must_fail git branch --no-contains=master -d && - test_must_fail git branch --no-contains=master -m foo + test_must_fail git branch --contains=main -d && + test_must_fail git branch --contains=main -m foo && + test_must_fail git branch --no-contains=main -d && + test_must_fail git branch --no-contains=main -m foo ' test_expect_success 'Assert that --contains only works on commits, not trees & blobs' ' - test_must_fail git branch --contains master^{tree} && + test_must_fail git branch --contains main^{tree} && blob=$(git hash-object -w --stdin <<-\EOF Some blob EOF @@ -175,11 +175,11 @@ test_expect_success 'Assert that --contains only works on commits, not trees & b ' test_expect_success 'multiple branch --contains' ' - git checkout -b side2 master && + git checkout -b side2 main && >feature && git add feature && git commit -m "add feature" && - git checkout -b next master && + git checkout -b next main && git merge side && git branch --contains side --contains side2 >actual && cat >expect <<-\EOF && @@ -191,9 +191,9 @@ test_expect_success 'multiple branch --contains' ' ' test_expect_success 'multiple branch --merged' ' - git branch --merged next --merged master >actual && + git branch --merged next --merged main >actual && cat >expect <<-\EOF && - master + main * next side EOF @@ -203,13 +203,13 @@ test_expect_success 'multiple branch --merged' ' test_expect_success 'multiple branch --no-contains' ' git branch --no-contains side --no-contains side2 >actual && cat >expect <<-\EOF && - master + main EOF test_cmp expect actual ' test_expect_success 'multiple branch --no-merged' ' - git branch --no-merged next --no-merged master >actual && + git branch --no-merged next --no-merged main >actual && cat >expect <<-\EOF && side2 EOF @@ -217,7 +217,7 @@ test_expect_success 'multiple branch --no-merged' ' ' test_expect_success 'branch --contains combined with --no-contains' ' - git checkout -b seen master && + git checkout -b seen main && git merge side && git merge side2 && git branch --contains side --no-contains side2 >actual && @@ -242,17 +242,17 @@ test_expect_success 'branch --merged combined with --no-merged' ' # that the latter walk does not mess up our flag to see if it was # merged). # -# Here "topic" tracks "master" with one extra commit, and "zzz" points to the -# same tip as master The name "zzz" must come alphabetically after "topic" +# Here "topic" tracks "main" with one extra commit, and "zzz" points to the +# same tip as main The name "zzz" must come alphabetically after "topic" # as we process them in that order. test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' ' - git branch --track topic master && + git branch --track topic main && git branch zzz topic && git checkout topic && test_commit foo && git branch --merged topic >actual && cat >expect <<-\EOF && - master + main * topic zzz EOF |