cargo/tests
Weihang Lo 8a4d04414e fix: normalize relative git submodule urls with ssh://
Git only assumes a submodule URL is a relative path if it starts with `./`
or `../` [^1]. To fetch the correct repo, we need to construct an aboslute
submodule URL.

At this moment it comes with some limitations:

* GitHub doesn't accept non-normalized URLs wth relative paths.
  (`ssh://git@github.com/rust-lang/cargo.git/relative/..` is invalid)
* `url` crate cannot parse SCP-like URLs.
  (`git@github.com:rust-lang/cargo.git` is not a valid WHATWG URL)

To overcome these, this patch always tries `Url::parse` first to normalize
the path. If it couldn't, append the relative path as the last resort and
pray the remote git service supports non-normalized URLs.

See also rust-lang/cargo#12404 and rust-lang/cargo#12295.

[^1]: <https://git-scm.com/docs/git-submodule>
2023-07-30 10:04:32 -07:00
..
build-std Add requirements to cargo_test. 2022-07-30 19:36:58 -07:00
testsuite fix: normalize relative git submodule urls with ssh:// 2023-07-30 10:04:32 -07:00