From: Nguyễn Thái Ngọc Duy Date: Mon, 28 Jan 2013 01:18:14 +0000 (+0700) Subject: branch: reject -D/-d without branch name X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=640d0401be5f29db8c9e914d8a19dbc9b950448d;p=git.git branch: reject -D/-d without branch name Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff --git a/builtin/branch.c b/builtin/branch.c index 873f624d1..50fcaccab 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -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);