aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2008-10-29 01:05:27 +0100
committerJunio C Hamano <gitster@pobox.com>2008-10-30 13:50:48 -0700
commitfa58186c9ba50514b36ac5ef192cd7e0bc4d7780 (patch)
treed8d68a5bfef9f96471195a93f8c30fbe6c5debf0 /t
parent569740bdd0533ef5cf032edd6233710161a35725 (diff)
downloadgit-fa58186c9ba50514b36ac5ef192cd7e0bc4d7780.tar.gz
git-fa58186c9ba50514b36ac5ef192cd7e0bc4d7780.tar.xz
git branch -m: forbid renaming of a symref
There may be cases where one would really want to rename the symbolic ref without changing its value, but "git branch -m" is not such a use-case. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t3200-branch.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index fdeb1f529..25e9971fd 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -112,13 +112,13 @@ 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' \
+test_expect_success 'renaming a symref is not allowed' \
'
git symbolic-ref refs/heads/master2 refs/heads/master &&
- git branch -m master2 master3 &&
- git symbolic-ref refs/heads/master3 &&
+ test_must_fail git branch -m master2 master3 &&
+ git symbolic-ref refs/heads/master2 &&
test -f .git/refs/heads/master &&
- ! test -f .git/refs/heads/master2
+ ! test -f .git/refs/heads/master3
'
test_expect_success \