builtin/difftool: use parse_oid_hex
[gitweb.git] / builtin / push.c
index ef4c188895beab317a66523b23a9f1c87e634405..021dd3b1e48979086de68a434d4eddbbeb074df3 100644 (file)
@@ -143,7 +143,9 @@ static int push_url_of_remote(struct remote *remote, const char ***url_p)
        return remote->url_nr;
 }
 
-static NORETURN int die_push_simple(struct branch *branch, struct remote *remote) {
+static NORETURN int die_push_simple(struct branch *branch,
+                                   struct remote *remote)
+{
        /*
         * There's no point in using shorten_unambiguous_ref here,
         * as the ambiguity would be on the remote side, not what
@@ -173,10 +175,10 @@ static NORETURN int die_push_simple(struct branch *branch, struct remote *remote
              "\n"
              "To push to the branch of the same name on the remote, use\n"
              "\n"
-             "    git push %s %s\n"
+             "    git push %s HEAD\n"
              "%s"),
            remote->name, short_upstream,
-           remote->name, branch->name, advice_maybe);
+           remote->name, advice_maybe);
 }
 
 static const char message_detached_head_die[] =
@@ -355,7 +357,8 @@ static int push_with_options(struct transport *transport, struct refspec *rs,
 
        if (verbosity > 0)
                fprintf(stderr, _("Pushing to %s\n"), transport->url);
-       err = transport_push(transport, rs, flags, &reject_reasons);
+       err = transport_push(the_repository, transport,
+                            rs, flags, &reject_reasons);
        if (err != 0) {
                fprintf(stderr, "%s", push_get_color(PUSH_COLOR_ERROR));
                error(_("failed to push some refs to '%s'"), transport->url);
@@ -561,7 +564,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
                  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",
+               { 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_BOOL_F( 0 , "thin", &thin, N_("use thin pack"), PARSE_OPT_NOCOMPLETE),
@@ -576,7 +579,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
                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"),
+                 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")),