diff options
author | Mike Frysinger <vapier@google.com> | 2023-12-18 16:31:11 -0500 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-12-19 18:00:44 +0000 |
commit | 48e4137eba1678c40a4caa92d9148a9ade76ec90 (patch) | |
tree | 39ebfdb36d7cbebcadf81e3d3e73afa1c77eb623 /tests | |
parent | 172c58398b340f30bad1902aebba9d198b5786f4 (diff) | |
download | git-repo-48e4137eba1678c40a4caa92d9148a9ade76ec90.tar.gz |
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_manifest_xml.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py index 11c0c15e..6423bb96 100644 --- a/tests/test_manifest_xml.py +++ b/tests/test_manifest_xml.py | |||
@@ -1139,6 +1139,17 @@ class NormalizeUrlTests(ManifestParseTestCase): | |||
1139 | "http://foo.com/bar/baz", manifest_xml.normalize_url(url) | 1139 | "http://foo.com/bar/baz", manifest_xml.normalize_url(url) |
1140 | ) | 1140 | ) |
1141 | 1141 | ||
1142 | def test_has_leading_slash(self): | ||
1143 | """SCP-like syntax except a / comes before the : which git disallows.""" | ||
1144 | url = "/git@foo.com:bar/baf" | ||
1145 | self.assertEqual(url, manifest_xml.normalize_url(url)) | ||
1146 | |||
1147 | url = "gi/t@foo.com:bar/baf" | ||
1148 | self.assertEqual(url, manifest_xml.normalize_url(url)) | ||
1149 | |||
1150 | url = "git@fo/o.com:bar/baf" | ||
1151 | self.assertEqual(url, manifest_xml.normalize_url(url)) | ||
1152 | |||
1142 | def test_has_no_scheme(self): | 1153 | def test_has_no_scheme(self): |
1143 | """Deal with cases where we have no scheme, but we also | 1154 | """Deal with cases where we have no scheme, but we also |
1144 | aren't dealing with the git SCP-like syntax | 1155 | aren't dealing with the git SCP-like syntax |