summaryrefslogtreecommitdiffstats
path: root/manifest_xml.py
diff options
context:
space:
mode:
authorVitalii Dmitriev <vitalii.dmitriev@unikie.com>2023-12-18 11:25:16 +0200
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-12-20 07:38:49 +0000
commit449b23b698d7d4b13909667a49a0698eb495eeaa (patch)
tree58a391c600b5838e1c660864ad102f9fb468d312 /manifest_xml.py
parente5fb6e585f593162ee2b10ad64cdd7ea2a577a06 (diff)
downloadgit-repo-449b23b698d7d4b13909667a49a0698eb495eeaa.tar.gz
manifest_xml: fix url normalization for inits and remotes
Before the change, repo normalizes the urls with a following format only: git@github.com:foo/bar It doesn't cover the following case: <remote name="org" fetch="git@github.com:org/" /> <project name="somerepo" remote="org" /> Results to: error: Cannot fetch somerepo from ssh://git@github.com/org/git@github.com:org/somerepo Current change fixes it by normalizing this format: git@github.com:foo Test: ./run_tests tests/test_manifest_xml.py Change-Id: I1ad0f5df0d52c0b7229ba4c9a4db4eecb5c1a003 Signed-off-by: Vitalii Dmitriev <vitalii.dmitriev@unikie.com> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/398337 Commit-Queue: Vitalii Dmitriev <dmit.vitalii@gmail.com> Tested-by: Vitalii Dmitriev <dmit.vitalii@gmail.com> Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'manifest_xml.py')
-rw-r--r--manifest_xml.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/manifest_xml.py b/manifest_xml.py
index 7e533a02..4f752122 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -133,8 +133,8 @@ def normalize_url(url: str) -> str:
133 url = url.rstrip("/") 133 url = url.rstrip("/")
134 parsed_url = urllib.parse.urlparse(url) 134 parsed_url = urllib.parse.urlparse(url)
135 135
136 # This matches patterns like "git@github.com:foo/bar". 136 # This matches patterns like "git@github.com:foo".
137 scp_like_url_re = r"^[^/:]+@[^/:]+:[^/]+/" 137 scp_like_url_re = r"^[^/:]+@[^/:]+:[^/]+"
138 138
139 # If our URL is missing a schema and matches git's 139 # If our URL is missing a schema and matches git's
140 # SCP-like syntax we should convert it to a proper 140 # SCP-like syntax we should convert it to a proper