]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3200-branch.sh
branch -d: refuse deleting a branch which is currently checked out
[thirdparty/git.git] / t / t3200-branch.sh
index a897248490650ebef1a33a60a1aa9cf4431f06ff..508007fd377260fd46e385d6a47b8a9732ef1dd0 100755 (executable)
@@ -403,6 +403,12 @@ test_expect_success 'test deleting branch without config' '
        test_i18ncmp expect actual
 '
 
+test_expect_success 'deleting currently checked out branch fails' '
+       git worktree add -b my7 my7 &&
+       test_must_fail git -C my7 branch -d my7 &&
+       test_must_fail git branch -d my7
+'
+
 test_expect_success 'test --track without .fetch entries' '
        git branch --track my8 &&
        test "$(git config branch.my8.remote)" &&