mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-26 20:17:52 +00:00
manifest_xml: do not allow / before : in scp-like syntax
Since git doesn't treat these as ssh:// URIs, we shouldn't either. Bug: https://g-issues.gerritcodereview.com/issues/40010331 Change-Id: I001f49be30395187cac447d09cb5a6c29e95768b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/398517 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jason Chang <jasonnc@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
This commit is contained in:
@ -1139,6 +1139,17 @@ class NormalizeUrlTests(ManifestParseTestCase):
|
||||
"http://foo.com/bar/baz", manifest_xml.normalize_url(url)
|
||||
)
|
||||
|
||||
def test_has_leading_slash(self):
|
||||
"""SCP-like syntax except a / comes before the : which git disallows."""
|
||||
url = "/git@foo.com:bar/baf"
|
||||
self.assertEqual(url, manifest_xml.normalize_url(url))
|
||||
|
||||
url = "gi/t@foo.com:bar/baf"
|
||||
self.assertEqual(url, manifest_xml.normalize_url(url))
|
||||
|
||||
url = "git@fo/o.com:bar/baf"
|
||||
self.assertEqual(url, manifest_xml.normalize_url(url))
|
||||
|
||||
def test_has_no_scheme(self):
|
||||
"""Deal with cases where we have no scheme, but we also
|
||||
aren't dealing with the git SCP-like syntax
|
||||
|
Reference in New Issue
Block a user