diff options
author | David Turner <dturner@twopensource.com> | 2016-02-24 17:58:51 -0500 |
---|---|---|
committer | Michael Haggerty <mhagger@alum.mit.edu> | 2016-06-13 11:23:49 +0200 |
commit | 12fd3496d19c33c6401c5fdc7558944d46124a0f (patch) | |
tree | 541a62489823b571ff738ef7a1f3ff875acafdb7 /t/t3200-branch.sh | |
parent | d99aa884dff33d48d5aab8c9cf989a25c779fd70 (diff) | |
download | git-12fd3496d19c33c6401c5fdc7558944d46124a0f.tar.gz |
refs: don't dereference on rename
When renaming refs, don't dereference either the origin or the destination
before renaming.
The origin does not need to be dereferenced because it is presently
forbidden to rename symbolic refs.
Not dereferencing the destination fixes a bug where renaming on top of
a broken symref would use the pointed-to ref name for the moved
reflog.
Add a test for the reflog bug.
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Diffstat (limited to 't/t3200-branch.sh')
-rwxr-xr-x | t/t3200-branch.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index f3e3b6cf2e..42811604bb 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -79,6 +79,15 @@ test_expect_success 'git branch -m dumps usage' ' test_i18ngrep "branch name required" err ' +test_expect_success 'git branch -m m broken_symref should work' ' + test_when_finished "git branch -D broken_symref" && + git branch -l m && + git symbolic-ref refs/heads/broken_symref refs/heads/i_am_broken && + git branch -m m broken_symref && + git reflog exists refs/heads/broken_symref && + test_must_fail git reflog exists refs/heads/i_am_broken +' + test_expect_success 'git branch -m m m/m should work' ' git branch -l m && git branch -m m m/m && |