Skip to content

attempt to fix scp style VCS url parsing

Warren Gifford requested to merge vcs-url-fix into main

Created by: arussellsaw

This PR adds a new vcs.URL wrapper type to fix issues with URL parsing introducing incorrect absolute paths, eg: [email protected]:foo/bar.git becomes ssh://[email protected]/foo/bar.git. On GitHub & GitLab this is fine, as they do non-standard things with their git to make this work, but standard git implementations treat those two urls differently, one being relative path and the other absolute from /.

This fix adds a wrapper vcs.URL with an overridden String() function, which will fall back to stdlib if a scheme is specified, but for URLs without a scheme uses a method that returns the original path unmutated.

fixes https://github.com/sourcegraph/customer/issues/316

Merge request reports

Loading