aboutsummaryrefslogtreecommitdiff
path: root/builtin/branch.c
diff options
context:
space:
mode:
authorKaartic Sivaraam <kaarticsivaraam91196@gmail.com>2017-08-21 19:06:08 +0530
committerJunio C Hamano <gitster@pobox.com>2017-10-04 13:08:17 +0900
commitf77762351445a73bbafc1464b4676d046e726468 (patch)
tree6ef70f3742099555cd2f01c1701c482d939c3ab7 /builtin/branch.c
parent4010f1d1b782eb7585e0e0abcefa794bd5ff29a0 (diff)
downloadgit-f77762351445a73bbafc1464b4676d046e726468.tar.gz
git-f77762351445a73bbafc1464b4676d046e726468.tar.xz
branch: change the error messages to be more meaningful
The error messages shown when the branch command is misused by supplying it wrong number of parameters wasn't meaningful. That's because it used the the phrase "too many branches" assuming all parameters to be "valid" branch names. It's not always the case as exemplified below, $ git branch foo * master $ git branch -m foo foo old fatal: too many branches for a rename operation Change the messages to be more general thus making no assumptions about the "parameters". Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@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, 3 insertions, 3 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index 16d391b40..6aba134db 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -711,12 +711,12 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
else if (argc == 2)
rename_branch(argv[0], argv[1], rename > 1);
else
- die(_("too many branches for a rename operation"));
+ die(_("too many arguments for a rename operation"));
} else if (new_upstream) {
struct branch *branch = branch_get(argv[0]);
if (argc > 1)
- die(_("too many branches to set new upstream"));
+ die(_("too many arguments to set new upstream"));
if (!branch) {
if (!argc || !strcmp(argv[0], "HEAD"))
@@ -739,7 +739,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
struct strbuf buf = STRBUF_INIT;
if (argc > 1)
- die(_("too many branches to unset upstream"));
+ die(_("too many arguments to unset upstream"));
if (!branch) {
if (!argc || !strcmp(argv[0], "HEAD"))