summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-10-23 05:14:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-10-23 05:14:16 (GMT)
commit5253ad109af7691d0b0fb3c9670aaaf775412c72 (patch)
tree00292a2eec45efa23eb82c27471f0730dd78a85d /t
parent4c2224e83951a685185bb8c1f83b28e22fee0e27 (diff)
parent31824d180d4f975e6b130cd9a33a9a0baef3d7ca (diff)
downloadgit-5253ad109af7691d0b0fb3c9670aaaf775412c72.zip
git-5253ad109af7691d0b0fb3c9670aaaf775412c72.tar.gz
git-5253ad109af7691d0b0fb3c9670aaaf775412c72.tar.bz2
Merge branch 'nd/worktree-kill-parse-ref' into maint
"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-xt/t3200-branch.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 9d707d2..5fc2fb4 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 &&