push: support signing pushes iff the server supports it
[gitweb.git] / builtin / send-pack.c
index 5f2c7441f3c6975b98edbc726b7ba82af9794aec..0ce3bc8c41985b0c55926db97fab47e24a581f18 100644 (file)
@@ -118,7 +118,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
        unsigned send_mirror = 0;
        unsigned force_update = 0;
        unsigned quiet = 0;
-       unsigned push_cert = 0;
+       int push_cert = 0;
        unsigned use_thin_pack = 0;
        unsigned atomic = 0;
        unsigned stateless_rpc = 0;
@@ -137,7 +137,9 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
                OPT_BOOL('n' , "dry-run", &dry_run, N_("dry run")),
                OPT_BOOL(0, "mirror", &send_mirror, N_("mirror all refs")),
                OPT_BOOL('f', "force", &force_update, N_("force updates")),
-               OPT_BOOL(0, "signed", &push_cert, N_("GPG sign the push")),
+               { OPTION_CALLBACK,
+                 0, "signed", &push_cert, "yes|no|if-asked", N_("GPG sign the push"),
+                 PARSE_OPT_OPTARG, option_parse_push_signed },
                OPT_BOOL(0, "progress", &progress, N_("force progress reporting")),
                OPT_BOOL(0, "thin", &use_thin_pack, N_("use thin pack")),
                OPT_BOOL(0, "atomic", &atomic, N_("request atomic transaction on remote side")),