1
0
mirror of https://github.com/git/git.git synced 2024-09-25 19:10:59 +02:00

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>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2013-01-28 08:18:14 +07:00 committed by Junio C Hamano
parent 50a6b54c03
commit 640d0401be

View 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);