diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2017-11-20 13:30:30 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-21 14:01:03 +0900 |
commit | a3f5b66fac3b5f3b2c352c8086dbc3d476f9e3d4 (patch) | |
tree | 5fbbe1a1105af18ba2b6e27188fee2a40234bb2b /connect.c | |
parent | 0da0e49ba12225684b75e86a4c9344ad121652cb (diff) | |
download | git-a3f5b66fac3b5f3b2c352c8086dbc3d476f9e3d4.tar.gz |
ssh: 'simple' variant does not support -4/-6
If the user passes -4/--ipv4 or -6/--ipv6 to "git fetch" or "git push"
and the ssh command configured with GIT_SSH does not support such a
setting, error out instead of ignoring the option and continuing.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'connect.c')
-rw-r--r-- | connect.c | 25 |
1 files changed, 22 insertions, 3 deletions
@@ -938,11 +938,30 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env, get_protocol_version_config()); } - if (variant != VARIANT_SIMPLE) { - if (flags & CONNECT_IPV4) + if (flags & CONNECT_IPV4) { + switch (variant) { + case VARIANT_AUTO: + BUG("VARIANT_AUTO passed to push_ssh_options"); + case VARIANT_SIMPLE: + die("ssh variant 'simple' does not support -4"); + case VARIANT_SSH: + case VARIANT_PLINK: + case VARIANT_PUTTY: + case VARIANT_TORTOISEPLINK: argv_array_push(args, "-4"); - else if (flags & CONNECT_IPV6) + } + } else if (flags & CONNECT_IPV6) { + switch (variant) { + case VARIANT_AUTO: + BUG("VARIANT_AUTO passed to push_ssh_options"); + case VARIANT_SIMPLE: + die("ssh variant 'simple' does not support -6"); + case VARIANT_SSH: + case VARIANT_PLINK: + case VARIANT_PUTTY: + case VARIANT_TORTOISEPLINK: argv_array_push(args, "-6"); + } } if (variant == VARIANT_TORTOISEPLINK) |