Clone with SSH not work if port is not 22
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 450
- Avg merge
- 11m
- Merged PRs (30d)
- 1
Description
Hi,
I have a git server which use different port as default 22, so when I try to clone it with something below:
builder.clone(
"foo@git.bar.com:23953/xxxxx",
Path::new("/tmp/git2-rs"),
)?;
It will timeout, and when I strace the process, I see it try to connect with the server at port 22, I didn't find some way to change the port, does anyone know how to do this? Thanks.
Best Regards,
Hermes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the builder.clone call shown in the issue and trace how SSH URLs are parsed and how the connection port is selected. Check the existing git2-rs and libgit2 SSH configuration APIs before adding coverage for a non-22 port. Done means cloning the example URL connects to port 23953 instead of timing out on port 22.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100