Skip to content

Commit c96e3ce

Browse files
committed
Merge branch 'sf/putty-w-args'
* sf/putty-w-args: connect.c: handle errors from split_cmdline
2 parents c2cbb30 + 22e5ae5 commit c96e3ce

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

connect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ static void handle_ssh_variant(const char *ssh_command, int is_cmdline,
730730
const char **ssh_argv;
731731

732732
p = xstrdup(ssh_command);
733-
if (split_cmdline(p, &ssh_argv)) {
733+
if (split_cmdline(p, &ssh_argv) > 0) {
734734
variant = basename((char *)ssh_argv[0]);
735735
/*
736736
* At this point, variant points into the buffer

t/t5601-clone.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,12 @@ test_expect_success 'GIT_SSH_VARIANT overrides plink to tortoiseplink' '
427427
expect_ssh "-batch -P 123" myhost src
428428
'
429429

430+
test_expect_success 'clean failure on broken quoting' '
431+
test_must_fail \
432+
env GIT_SSH_COMMAND="${SQ}plink.exe -v" \
433+
git clone "[myhost:123]:src" sq-failure
434+
'
435+
430436
# Reset the GIT_SSH environment variable for clone tests.
431437
setup_ssh_wrapper
432438

0 commit comments

Comments
 (0)