transport_check_allowed("git");
- /* These underlying connection commands die() if they
+ /*
+ * These underlying connection commands die() if they
* cannot connect.
*/
if (git_use_proxy(hostandport))
if (variant == VARIANT_TORTOISEPLINK)
argv_array_push(args, "-batch");
- if (port && variant != VARIANT_SIMPLE) {
- if (variant == VARIANT_SSH)
+ if (port) {
+ switch (variant) {
+ case VARIANT_AUTO:
+ BUG("VARIANT_AUTO passed to push_ssh_options");
+ case VARIANT_SIMPLE:
+ die("ssh variant 'simple' does not support setting port");
+ case VARIANT_SSH:
argv_array_push(args, "-p");
- else
+ break;
+ case VARIANT_PLINK:
+ case VARIANT_PUTTY:
+ case VARIANT_TORTOISEPLINK:
argv_array_push(args, "-P");
+ }
argv_array_push(args, port);
}