mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
transport-helper: check if the dry-run is supported
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>
This commit is contained in:
parent
67c9c782da
commit
21457f5719
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue