summaryrefslogtreecommitdiff
path: root/t/t3200-branch.sh
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2008-10-26 03:33:56 +0100
committerJunio C Hamano <gitster@pobox.com>2008-10-26 14:42:57 -0700
commiteca35a25a92a1ad725af2a549fc9158488c4cc43 (patch)
treed598c2304f5c3f6d4bee5aa2cb4ce15fab117bf2 /t/t3200-branch.sh
parent031e6c898f61db1ae0c0be641eac6532c1000d56 (diff)
downloadgit-eca35a25a92a1ad725af2a549fc9158488c4cc43.tar.gz
Fix git branch -m for symrefs.
This had two problems with symrefs. First, it copied the actual sha1 instead of the "pointer", second it failed to remove the old ref after a successful rename. Given that till now delete_ref() always dereferenced symrefs, a new parameters has been introduced to delete_ref() to allow deleting refs without a dereference. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3200-branch.sh')
-rwxr-xr-xt/t3200-branch.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 2147eacc50..fdeb1f529c 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -112,6 +112,15 @@ test_expect_success 'config information was renamed, too' \
"test $(git config branch.s.dummy) = Hello &&
test_must_fail git config branch.s/s/dummy"
+test_expect_success 'renaming a symref' \
+'
+ git symbolic-ref refs/heads/master2 refs/heads/master &&
+ git branch -m master2 master3 &&
+ git symbolic-ref refs/heads/master3 &&
+ test -f .git/refs/heads/master &&
+ ! test -f .git/refs/heads/master2
+'
+
test_expect_success \
'git branch -m u v should fail when the reflog for u is a symlink' '
git branch -l u &&