8000 Merge pull request #6845 from jayong93/no-default-ssh-port · libgit2/libgit2@cb0bf67 · GitHub
[go: up one dir, main page]

Skip to co 8000 ntent

Commit cb0bf67

Browse files
authored
Merge pull request #6845 from jayong93/no-default-ssh-port
2 parents 34432d9 + d2389b2 commit cb0bf67

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/libgit2/transports/ssh_exec.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,10 @@ static int get_ssh_cmdline(
158158
else if ((error = git_config__get_string_buf(&ssh_cmd, cfg, "core.sshcommand")) < 0 && error != GIT_ENOTFOUND)
159159
goto done;
160160

161-
error = git_str_printf(out, "%s -p %s \"%s%s%s\" \"%s\" \"%s\"",
161+
error = git_str_printf(out, "%s %s %s \"%s%s%s\" \"%s\" \"%s\"",
162162
ssh_cmd.size > 0 ? ssh_cmd.ptr : default_ssh_cmd,
163-
url->port,
163+
url->port_specified ? "-p" : "",
164+
url->port_specified ? url->port : "",
164165
url->username ? url->username : "",
165166
url->username ? "@" : "",
166167
url->host,

0 commit comments

Comments
 (0)
0