diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2013-01-28 08:18:14 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-30 09:00:41 -0800 |
commit | 640d0401be5f29db8c9e914d8a19dbc9b950448d (patch) | |
tree | 91bac8d3a48191f3c2343b390d7ab92a4a2ffe58 /builtin | |
parent | 50a6b54c03219ad74b9f3f839e0321be18daeaf6 (diff) | |
download | git-640d0401be5f29db8c9e914d8a19dbc9b950448d.tar.gz |
branch: reject -D/-d without branch name
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/branch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/branch.c b/builtin/branch.c index 873f624d1c..50fcaccab0 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); |