diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-09-10 10:08:23 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-10 10:08:24 +0200 |
commit | 79553b94f966f3cec6156a68001650ca26a584c4 (patch) | |
tree | 37c0d1de2d26a28d67e06993819e8965dd25e942 /t | |
parent | Merge branch 'mm/send-email-cc-cruft' (diff) | |
parent | branch: fix branch renaming not updating HEADs correctly (diff) | |
download | git-79553b94f966f3cec6156a68001650ca26a584c4.tar.xz git-79553b94f966f3cec6156a68001650ca26a584c4.zip |
Merge branch 'nd/worktree-kill-parse-ref'
"git branch -M a b" while on a branch that is completely unrelated
to either branch a or branch b misbehaved when multiple worktree
was in use. This has been fixed.
* nd/worktree-kill-parse-ref:
branch: fix branch renaming not updating HEADs correctly
Diffstat (limited to 't')
-rwxr-xr-x | t/t3200-branch.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index 51738fb969..d971649979 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -162,6 +162,19 @@ test_expect_success 'git branch -M baz bam should add entries to .git/logs/HEAD' grep "^0\{40\}.*$msg$" .git/logs/HEAD ' +test_expect_success 'git branch -M should leave orphaned HEAD alone' ' + git init orphan && + ( + cd orphan && + test_commit initial && + git checkout --orphan lonely && + grep lonely .git/HEAD && + test_path_is_missing .git/refs/head/lonely && + git branch -M master mistress && + grep lonely .git/HEAD + ) +' + test_expect_success 'resulting reflog can be shown by log -g' ' oid=$(git rev-parse HEAD) && cat >expect <<-EOF && |