summaryrefslogtreecommitdiff
path: root/builtin/branch.c
diff options
context:
space:
mode:
authorJonathon Mah <me@JonathonMah.com>2013-03-31 01:27:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-04-01 02:58:02 (GMT)
commitd1520c4b1a6105356c7a2def6b90239057270598 (patch)
tree04753c6f1192a4c64116f0e41962350848888268 /builtin/branch.c
parent631bc94e67383b66da190550866566f09d32f299 (diff)
downloadgit-d1520c4b1a6105356c7a2def6b90239057270598.zip
git-d1520c4b1a6105356c7a2def6b90239057270598.tar.gz
git-d1520c4b1a6105356c7a2def6b90239057270598.tar.bz2
branch: give better message when no names specified for rename
Signed-off-by: Jonathon Mah <me@JonathonMah.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 00d17d2..580107f 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -880,7 +880,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);