aboutsummaryrefslogtreecommitdiff
path: root/builtin/branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-03 09:34:40 -0700
committerJunio C Hamano <gitster@pobox.com>2013-04-03 09:34:40 -0700
commit8054b9a6153dffca012efe609ffa18004e8251e5 (patch)
treec531fc91bafab1342ca5c994b8afbb2bf77c9933 /builtin/branch.c
parented23f31bbe370eee92a06900b898a969efb80d31 (diff)
parentd1520c4b1a6105356c7a2def6b90239057270598 (diff)
downloadgit-8054b9a6153dffca012efe609ffa18004e8251e5.tar.gz
git-8054b9a6153dffca012efe609ffa18004e8251e5.tar.xz
Merge branch 'jm/branch-rename-nothing-error'
"git branch -m" without any argument noticed an error, but with an incorrect error message. * jm/branch-rename-nothing-error: branch: give better message when no names specified for rename
Diffstat (limited to 'builtin/branch.c')
-rw-r--r--builtin/branch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index e09ce51c2..3f0fbc082 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -904,7 +904,9 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
if (edit_branch_description(branch_name))
return 1;
} else if (rename) {
- if (argc == 1)
+ if (!argc)
+ die(_("branch name required"));
+ else if (argc == 1)
rename_branch(head, argv[0], rename > 1);
else if (argc == 2)
rename_branch(argv[0], argv[1], rename > 1);