summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-04-19 21:37:24 -0700
committerJunio C Hamano <gitster@pobox.com>2017-04-19 21:37:24 -0700
commitc96e3ce62523429a10026c932ceef41eb4aad3dd (patch)
tree786b15e70ca6c5149360120509f7a89b6f19d49b
parentc2cbb30fc075d9bf926a739d05712b4debae4b97 (diff)
parent22e5ae5c8e6859e5670a2c6bbf5798778373144c (diff)
downloadgit-c96e3ce62523429a10026c932ceef41eb4aad3dd.tar.gz
Merge branch 'sf/putty-w-args'
* sf/putty-w-args: connect.c: handle errors from split_cmdline
-rw-r--r--connect.c2
-rwxr-xr-xt/t5601-clone.sh6
2 files changed, 7 insertions, 1 deletions
diff --git a/connect.c b/connect.c
index 6afde189a3..568a35f754 100644
--- a/connect.c
+++ b/connect.c
@@ -730,7 +730,7 @@ static void handle_ssh_variant(const char *ssh_command, int is_cmdline,
const char **ssh_argv;
p = xstrdup(ssh_command);
- if (split_cmdline(p, &ssh_argv)) {
+ if (split_cmdline(p, &ssh_argv) > 0) {
variant = basename((char *)ssh_argv[0]);
/*
* At this point, variant points into the buffer
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index b52b8acf98..9c56f771b6 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -427,6 +427,12 @@ test_expect_success 'GIT_SSH_VARIANT overrides plink to tortoiseplink' '
expect_ssh "-batch -P 123" myhost src
'
+test_expect_success 'clean failure on broken quoting' '
+ test_must_fail \
+ env GIT_SSH_COMMAND="${SQ}plink.exe -v" \
+ git clone "[myhost:123]:src" sq-failure
+'
+
# Reset the GIT_SSH environment variable for clone tests.
setup_ssh_wrapper