Skip to content

Commit

Permalink
transport-helper: check if the dry-run is supported
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Felipe Contreras authored and Junio C Hamano committed May 21, 2013
1 parent 67c9c78 commit 21457f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions transport-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 21457f5

Please sign in to comment.