aboutsummaryrefslogtreecommitdiff
path: root/t/t3200-branch.sh
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2017-02-20 20:10:34 -0500
committerJunio C Hamano <gitster@pobox.com>2017-02-20 22:04:47 -0800
commit893dbf5ba16c47c7284209bc6c527195f368ee35 (patch)
tree6c71c65515ed4a843cc1a53bbe3d7539d3cfa4a9 /t/t3200-branch.sh
parentde922669ab0508109cdb5672e5515f7524e3ccf8 (diff)
downloadgit-893dbf5ba16c47c7284209bc6c527195f368ee35.tar.gz
git-893dbf5ba16c47c7284209bc6c527195f368ee35.tar.xz
rename_ref: replace empty message in HEAD's log
When the current branch is renamed, the deletion of the old ref is recorded in HEAD's log with an empty message. Now that delete_ref() accepts a reflog message, provide a more descriptive message by passing along the log message that is given to rename_ref(). The next step will be to extend HEAD's log to also include the second part of the rename, the creation of the new branch. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Kyle Meyer <kyle@kyleam.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3200-branch.sh')
-rwxr-xr-xt/t3200-branch.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 8a833f354..47bc15128 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -139,6 +139,11 @@ test_expect_success 'git branch -M baz bam should succeed when baz is checked ou
test $(git rev-parse --abbrev-ref HEAD) = bam
'
+test_expect_success 'git branch -M baz bam should add entry to .git/logs/HEAD' '
+ msg="Branch: renamed refs/heads/baz to refs/heads/bam" &&
+ grep " 0\{40\}.*$msg$" .git/logs/HEAD
+'
+
test_expect_success 'git branch -M baz bam should succeed when baz is checked out as linked working tree' '
git checkout master &&
git worktree add -b baz bazdir &&