]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/branch.c
branch: reject -D/-d without branch name
[thirdparty/git.git] / builtin / branch.c
index 873f624d1cc70e03da4c67b30f8c839b4afe099d..50fcaccab0651a1ad3afb8d02691317756e46d1d 100644 (file)
@@ -837,9 +837,11 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
                colopts = 0;
        }
 
-       if (delete)
+       if (delete) {
+               if (!argc)
+                       die(_("branch name required"));
                return delete_branches(argc, argv, delete > 1, kinds, quiet);
-       else if (list) {
+       else if (list) {
                int ret = print_ref_list(kinds, detached, verbose, abbrev,
                                         with_commit, argv);
                print_columns(&output, colopts, NULL);