aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-11-18 19:32:58 -0800
committerJunio C Hamano <gitster@pobox.com>2012-11-18 19:32:58 -0800
commit3a9866919c1f87c7e4f740ea6699513381256103 (patch)
tree46a5bbc39c547fddb229f9b2f3ac75c63d9bda8f /t
parentdca5ed5f5b2646186ce177bb41974035f8fefd52 (diff)
parent13baa9fe866f63311af5a5ee318beddb16eb5df4 (diff)
downloadgit-3a9866919c1f87c7e4f740ea6699513381256103.tar.gz
git-3a9866919c1f87c7e4f740ea6699513381256103.tar.xz
Merge branch 'rs/branch-del-symref' into maint
A symbolic ref refs/heads/SYM was not correctly removed with "git branch -d SYM"; the command removed the ref pointed by SYM instead. * rs/branch-del-symref: branch: show targets of deleted symrefs, not sha1s branch: skip commit checks when deleting symref branches branch: delete symref branch, not its target branch: factor out delete_branch_config() branch: factor out check_branch_commit()
Diffstat (limited to 't')
-rwxr-xr-xt/t3200-branch.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 79c8d0142..80e6be39d 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -262,6 +262,25 @@ 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 'deleting a symref' '
+ git branch target &&
+ git symbolic-ref refs/heads/symref refs/heads/target &&
+ echo "Deleted branch symref (was refs/heads/target)." >expect &&
+ git branch -d symref >actual &&
+ test_path_is_file .git/refs/heads/target &&
+ test_path_is_missing .git/refs/heads/symref &&
+ test_i18ncmp expect actual
+'
+
+test_expect_success 'deleting a dangling symref' '
+ git symbolic-ref refs/heads/dangling-symref nowhere &&
+ test_path_is_file .git/refs/heads/dangling-symref &&
+ echo "Deleted branch dangling-symref (was nowhere)." >expect &&
+ git branch -d dangling-symref >actual &&
+ test_path_is_missing .git/refs/heads/dangling-symref &&
+ test_i18ncmp expect actual
+'
+
test_expect_success 'renaming a symref is not allowed' \
'
git symbolic-ref refs/heads/master2 refs/heads/master &&