Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Add port to SCP Endpoints #608

Merged
merged 2 commits into from
Sep 29, 2017
Merged

Add port to SCP Endpoints #608

merged 2 commits into from
Sep 29, 2017

Conversation

balkian
Copy link
Contributor

@balkian balkian commented Sep 28, 2017

The port for SCP-like URLs was hardcoded to 22.
This commit modifies the regex to find a port (optional), and adds a new test case that covers this scenario.

All tests pass, and I've tried cloning a repo with a custom port through the command line example and it works.

Some notes:

  • 22 is kept as the default port. The ssh transport also has a default port defined . It may be best to use 0 and let the ssh transport handle it.
  • I use strconv.Atoi in the getter method to mimic the behavior of the other types. It might be more efficient to just parse it once after the regex.

The port for SCP-like URLs was hardcoded to 22.
This commit modifies the regex to find a port (optional), and adds a new test
case that covers this scenario.
@balkian balkian changed the title Adds port to SCP Endpoints Add port to SCP Endpoints Sep 28, 2017
URLs should be user@server:port/path instead of user@server:port:path
@codecov
Copy link

codecov bot commented Sep 28, 2017

Codecov Report

Merging #608 into master will decrease coverage by 0.57%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #608      +/-   ##
==========================================
- Coverage   78.31%   77.74%   -0.58%     
==========================================
  Files         130      130              
  Lines       10135    10140       +5     
==========================================
- Hits         7937     7883      -54     
- Misses       1347     1419      +72     
+ Partials      851      838      -13
Impacted Files Coverage Δ
plumbing/transport/common.go 92.4% <100%> (+0.51%) ⬆️
plumbing/transport/ssh/common.go 20.54% <0%> (-45.21%) ⬇️
plumbing/transport/ssh/auth_method.go 31.57% <0%> (-22.81%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d1595f...0ddf8f5. Read the comment docs.

@mcuadros
Copy link
Contributor

Awesome tanks!

@mcuadros mcuadros merged commit 30a99a2 into src-d:master Sep 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants