diff options
Diffstat (limited to 't/t2012-checkout-last.sh')
-rwxr-xr-x | t/t2012-checkout-last.sh | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/t/t2012-checkout-last.sh b/t/t2012-checkout-last.sh index e7ba8c505f..028a00d6ba 100755 --- a/t/t2012-checkout-last.sh +++ b/t/t2012-checkout-last.sh @@ -2,6 +2,9 @@ test_description='checkout can switch to last branch and merge base' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh test_expect_success 'setup' ' @@ -24,7 +27,7 @@ test_expect_success 'first branch switch' ' test_expect_success '"checkout -" switches back' ' git checkout - && - test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master" + test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main" ' test_expect_success '"checkout -" switches forth' ' @@ -98,56 +101,56 @@ test_expect_success 'merge base test setup' ' git commit -m third ' -test_expect_success 'another...master' ' +test_expect_success 'another...main' ' git checkout another && - git checkout another...master && - test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)" + git checkout another...main && + test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)" ' -test_expect_success '...master' ' +test_expect_success '...main' ' git checkout another && - git checkout ...master && - test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)" + git checkout ...main && + test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)" ' -test_expect_success 'master...' ' +test_expect_success 'main...' ' git checkout another && - git checkout master... && - test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)" + git checkout main... && + test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)" ' test_expect_success '"checkout -" works after a rebase A' ' - git checkout master && + git checkout main && git checkout other && - git rebase master && + git rebase main && git checkout - && - test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master" + test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main" ' test_expect_success '"checkout -" works after a rebase A B' ' - git branch moodle master~1 && - git checkout master && + git branch moodle main~1 && + git checkout main && git checkout other && - git rebase master moodle && + git rebase main moodle && git checkout - && - test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master" + test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main" ' test_expect_success '"checkout -" works after a rebase -i A' ' - git checkout master && + git checkout main && git checkout other && - git rebase -i master && + git rebase -i main && git checkout - && - test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master" + test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main" ' test_expect_success '"checkout -" works after a rebase -i A B' ' - git branch foodle master~1 && - git checkout master && + git branch foodle main~1 && + git checkout main && git checkout other && - git rebase master foodle && + git rebase main foodle && git checkout - && - test "z$(git symbolic-ref HEAD)" = "zrefs/heads/master" + test "z$(git symbolic-ref HEAD)" = "zrefs/heads/main" ' test_done |