git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] transport-helper: check if the dry-run is supported
@ 2013-05-21  1:32 Felipe Contreras
  2013-05-21 16:55 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Felipe Contreras @ 2013-05-21  1:32 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Sverre Rabbelier, Jeff King, Felipe Contreras

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 <felipe.contreras@gmail.com>
---
 transport-helper.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/transport-helper.c b/transport-helper.c
index 522d791..c8c39fc 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -789,6 +789,11 @@ static int push_refs_with_export(struct transport *transport,
 	struct string_list revlist_args = STRING_LIST_INIT_NODUP;
 	struct strbuf buf = STRBUF_INIT;
 
+	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.1.gf11a2b7.dirty

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-22  3:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-21  1:32 [PATCH v2] transport-helper: check if the dry-run is supported Felipe Contreras
2013-05-21 16:55 ` Junio C Hamano
2013-05-21 21:14   ` Felipe Contreras
2013-05-22  0:47     ` Junio C Hamano
2013-05-22  3:07       ` Felipe Contreras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).