diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/t3200-branch.sh | 32 | ||||
-rwxr-xr-x | t/t3203-branch-output.sh | 5 |
2 files changed, 37 insertions, 0 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index 9e69c8c926..c466b2065d 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -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' ' diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh index 6b7c118e4f..97d10b1884 100755 --- a/t/t3203-branch-output.sh +++ b/t/t3203-branch-output.sh @@ -32,6 +32,11 @@ test_expect_success 'git branch shows local branches' ' test_cmp expect actual ' +test_expect_success 'git branch --list shows local branches' ' + git branch --list >actual && + test_cmp expect actual +' + cat >expect <<'EOF' origin/HEAD -> origin/branch-one origin/branch-one |