diff options
Diffstat (limited to 'builtin/push.c')
-rw-r--r-- | builtin/push.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/builtin/push.c b/builtin/push.c index 6dbf0f0bb7..bc94078e72 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -340,6 +340,7 @@ static int push_with_options(struct transport *transport, struct refspec *rs, { int err; unsigned int reject_reasons; + char *anon_url = transport_anonymize_url(transport->url); transport_set_verbosity(transport, verbosity, progress); transport->family = family; @@ -357,18 +358,19 @@ static int push_with_options(struct transport *transport, struct refspec *rs, } if (verbosity > 0) - fprintf(stderr, _("Pushing to %s\n"), transport->url); + fprintf(stderr, _("Pushing to %s\n"), anon_url); trace2_region_enter("push", "transport_push", the_repository); err = transport_push(the_repository, transport, rs, flags, &reject_reasons); trace2_region_leave("push", "transport_push", the_repository); if (err != 0) { fprintf(stderr, "%s", push_get_color(PUSH_COLOR_ERROR)); - error(_("failed to push some refs to '%s'"), transport->url); + error(_("failed to push some refs to '%s'"), anon_url); fprintf(stderr, "%s", push_get_color(PUSH_COLOR_RESET)); } err |= transport_disconnect(transport); + free(anon_url); if (!err) return 0; @@ -434,10 +436,8 @@ static int option_parse_recurse_submodules(const struct option *opt, if (unset) *recurse_submodules = RECURSE_SUBMODULES_OFF; - else if (arg) - *recurse_submodules = parse_push_recurse_submodules_arg(opt->long_name, arg); else - die("%s missing parameter", opt->long_name); + *recurse_submodules = parse_push_recurse_submodules_arg(opt->long_name, arg); return 0; } @@ -548,13 +548,11 @@ int cmd_push(int argc, const char **argv, const char *prefix) OPT_BIT('n' , "dry-run", &flags, N_("dry run"), TRANSPORT_PUSH_DRY_RUN), OPT_BIT( 0, "porcelain", &flags, N_("machine-readable output"), TRANSPORT_PUSH_PORCELAIN), OPT_BIT('f', "force", &flags, N_("force updates"), TRANSPORT_PUSH_FORCE), - { OPTION_CALLBACK, - 0, CAS_OPT_NAME, &cas, N_("<refname>:<expect>"), - N_("require old value of ref to be at this value"), - PARSE_OPT_OPTARG | PARSE_OPT_LITERAL_ARGHELP, parseopt_push_cas_option }, - { OPTION_CALLBACK, 0, "recurse-submodules", &recurse_submodules, "(check|on-demand|no)", - N_("control recursive pushing of submodules"), - PARSE_OPT_OPTARG, option_parse_recurse_submodules }, + OPT_CALLBACK_F(0, CAS_OPT_NAME, &cas, N_("<refname>:<expect>"), + N_("require old value of ref to be at this value"), + PARSE_OPT_OPTARG | PARSE_OPT_LITERAL_ARGHELP, parseopt_push_cas_option), + OPT_CALLBACK(0, "recurse-submodules", &recurse_submodules, "(check|on-demand|no)", + N_("control recursive pushing of submodules"), option_parse_recurse_submodules), OPT_BOOL_F( 0 , "thin", &thin, N_("use thin pack"), PARSE_OPT_NOCOMPLETE), OPT_STRING( 0 , "receive-pack", &receivepack, "receive-pack", N_("receive pack program")), OPT_STRING( 0 , "exec", &receivepack, "receive-pack", N_("receive pack program")), @@ -566,9 +564,8 @@ int cmd_push(int argc, const char **argv, const char *prefix) OPT_BIT(0, "no-verify", &flags, N_("bypass pre-push hook"), TRANSPORT_PUSH_NO_HOOK), OPT_BIT(0, "follow-tags", &flags, N_("push missing but relevant tags"), TRANSPORT_PUSH_FOLLOW_TAGS), - { OPTION_CALLBACK, - 0, "signed", &push_cert, "(yes|no|if-asked)", N_("GPG sign the push"), - PARSE_OPT_OPTARG, option_parse_push_signed }, + OPT_CALLBACK_F(0, "signed", &push_cert, "(yes|no|if-asked)", N_("GPG sign the push"), + PARSE_OPT_OPTARG, option_parse_push_signed), OPT_BIT(0, "atomic", &flags, N_("request atomic transaction on remote side"), TRANSPORT_PUSH_ATOMIC), OPT_STRING_LIST('o', "push-option", &push_options_cmdline, N_("server-specific"), N_("option to transmit")), OPT_SET_INT('4', "ipv4", &family, N_("use IPv4 addresses only"), |