diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2020-12-11 11:36:55 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-12-13 15:53:50 -0800 |
commit | cfaff3aac8063ec72f03c6761328c7fa44a15b34 (patch) | |
tree | c8fbd9daf268b486d048b26859af35fbafcc83c0 /t/t0001-init.sh | |
parent | init: document `init.defaultBranch` better (diff) | |
download | tgif-cfaff3aac8063ec72f03c6761328c7fa44a15b34.tar.xz |
branch -m: allow renaming a yet-unborn branch
In one of the next commits, we would like to give users some advice
regarding the initial branch name, and how to modify it.
To that end, it would be good if `git branch -m <name>` worked in a
freshly initialized repository without any commits. Let's make it so.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0001-init.sh')
-rwxr-xr-x | t/t0001-init.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t0001-init.sh b/t/t0001-init.sh index 69a320489f..bb23e56a16 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -571,4 +571,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 |