Code

branch: introduce --list option
[git.git] / t / t3200-branch.sh
index 9e69c8c926620f06343e64e7b3aa3e4ada5a6b69..c466b2065dd76a505a6e2ef946cd8c9866090780 100755 (executable)
@@ -98,6 +98,38 @@ test_expect_success 'git branch -m q r/q should fail when r exists' '
        test_must_fail git branch -m q r/q
 '
 
+test_expect_success 'git branch -v -d t should work' '
+       git branch t &&
+       test .git/refs/heads/t &&
+       git branch -v -d t &&
+       test ! -f .git/refs/heads/t
+'
+
+test_expect_success 'git branch -v -m t s should work' '
+       git branch t &&
+       test .git/refs/heads/t &&
+       git branch -v -m t s &&
+       test ! -f .git/refs/heads/t &&
+       test -f .git/refs/heads/s &&
+       git branch -d s
+'
+
+test_expect_success 'git branch -m -d t s should fail' '
+       git branch t &&
+       test .git/refs/heads/t &&
+       test_must_fail git branch -m -d t s &&
+       git branch -d t &&
+       test ! -f .git/refs/heads/t
+'
+
+test_expect_success 'git branch --list -d t should fail' '
+       git branch t &&
+       test .git/refs/heads/t &&
+       test_must_fail git branch --list -d t &&
+       git branch -d t &&
+       test ! -f .git/refs/heads/t
+'
+
 mv .git/config .git/config-saved
 
 test_expect_success 'git branch -m q q2 without config should succeed' '