summaryrefslogtreecommitdiff
path: root/t/t0001-init.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t0001-init.sh')
-rwxr-xr-xt/t0001-init.sh17
1 files changed, 16 insertions, 1 deletions
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 69a3204..0803994 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -163,7 +163,7 @@ test_expect_success 'reinit' '
(
mkdir again &&
cd again &&
- git init >out1 2>err1 &&
+ git -c init.defaultBranch=initial init >out1 2>err1 &&
git init >out2 2>err2
) &&
test_i18ngrep "Initialized empty" again/out1 &&
@@ -558,6 +558,13 @@ test_expect_success 'overridden default initial branch name (config)' '
grep nmb actual
'
+test_expect_success 'advice on unconfigured init.defaultBranch' '
+ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= git -c color.advice=always \
+ init unconfigured-default-branch-name 2>err &&
+ test_decode_color <err >decoded &&
+ test_i18ngrep "<YELLOW>hint: " decoded
+'
+
test_expect_success 'overridden default main branch name (env)' '
test_config_global init.defaultBranch nmb &&
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=env git init main-branch-env &&
@@ -571,4 +578,12 @@ test_expect_success 'invalid default branch name' '
test_i18ngrep "invalid branch name" err
'
+test_expect_success 'branch -m with the initial branch' '
+ git init rename-initial &&
+ git -C rename-initial branch -m renamed &&
+ test renamed = $(git -C rename-initial symbolic-ref --short HEAD) &&
+ git -C rename-initial branch -m renamed again &&
+ test again = $(git -C rename-initial symbolic-ref --short HEAD)
+'
+
test_done