summaryrefslogtreecommitdiff
path: root/t/t2011-checkout-invalid-head.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t2011-checkout-invalid-head.sh')
-rwxr-xr-xt/t2011-checkout-invalid-head.sh19
1 files changed, 11 insertions, 8 deletions
diff --git a/t/t2011-checkout-invalid-head.sh b/t/t2011-checkout-invalid-head.sh
index 0e8d56aa76..e52022e152 100755
--- a/t/t2011-checkout-invalid-head.sh
+++ b/t/t2011-checkout-invalid-head.sh
@@ -2,6 +2,9 @@
test_description='checkout switching away from an invalid branch'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
test_expect_success 'setup' '
@@ -11,12 +14,12 @@ test_expect_success 'setup' '
'
test_expect_success 'checkout should not start branch from a tree' '
- test_must_fail git checkout -b newbranch master^{tree}
+ test_must_fail git checkout -b newbranch main^{tree}
'
-test_expect_success 'checkout master from invalid HEAD' '
+test_expect_success 'checkout main from invalid HEAD' '
echo $ZERO_OID >.git/HEAD &&
- git checkout master --
+ git checkout main --
'
test_expect_success 'checkout notices failure to lock HEAD' '
@@ -26,7 +29,7 @@ test_expect_success 'checkout notices failure to lock HEAD' '
'
test_expect_success 'create ref directory/file conflict scenario' '
- git update-ref refs/heads/outer/inner master &&
+ git update-ref refs/heads/outer/inner main &&
# do not rely on symbolic-ref to get a known state,
# as it may use the same code we are testing
@@ -37,12 +40,12 @@ test_expect_success 'create ref directory/file conflict scenario' '
test_expect_success 'checkout away from d/f HEAD (unpacked, to branch)' '
reset_to_df &&
- git checkout master
+ git checkout main
'
test_expect_success 'checkout away from d/f HEAD (unpacked, to detached)' '
reset_to_df &&
- git checkout --detach master
+ git checkout --detach main
'
test_expect_success 'pack refs' '
@@ -51,11 +54,11 @@ test_expect_success 'pack refs' '
test_expect_success 'checkout away from d/f HEAD (packed, to branch)' '
reset_to_df &&
- git checkout master
+ git checkout main
'
test_expect_success 'checkout away from d/f HEAD (packed, to detached)' '
reset_to_df &&
- git checkout --detach master
+ git checkout --detach main
'
test_done