From: Felipe Contreras Date: Sat, 25 May 2013 02:47:32 GMT Subject: [PATCH 1/9] transport-helper: check if the dry-run is supported Message-ID: <1369450060-19011-2-git-send-email-felipe.contreras@gmail.com> In-Reply-To: <1369450060-19011-1-git-send-email-felipe.contreras@gmail.com> Certain remote-helpers (the ones with 'export') would try to push regardless. Obviously this is not what the user wants. Also, add a check for the 'dry-run' option, so remote-helpers can implement it. Signed-off-by: Felipe Contreras --- transport-helper.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/transport-helper.c b/transport-helper.c index 2f5ac3f..85c951f 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -809,6 +809,11 @@ static int push_refs_with_export(struct transport *transport, if (!data->refspecs) die("remote-helper doesn't support push; refspec needed"); + if (flags & TRANSPORT_PUSH_DRY_RUN) { + if (set_helper_option(transport, "dry-run", "true") != 0) + die("helper %s does not support dry-run", data->name); + } + helper = get_helper(transport); write_constant(helper->in, "export\n"); -- 1.8.3.rc3.312.g47657de