summaryrefslogtreecommitdiff
path: root/builtin/branch.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-01-28 01:18:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-01-30 17:00:41 (GMT)
commit640d0401be5f29db8c9e914d8a19dbc9b950448d (patch)
tree91bac8d3a48191f3c2343b390d7ab92a4a2ffe58 /builtin/branch.c
parent50a6b54c03219ad74b9f3f839e0321be18daeaf6 (diff)
downloadgit-640d0401be5f29db8c9e914d8a19dbc9b950448d.zip
git-640d0401be5f29db8c9e914d8a19dbc9b950448d.tar.gz
git-640d0401be5f29db8c9e914d8a19dbc9b950448d.tar.bz2
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/branch.c')
-rw-r--r--builtin/branch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index 873f624..50fcacc 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);