From 7b9151e90baf5405839e71987ac9e8e8896037c5 Mon Sep 17 00:00:00 2001 From: Jesse Johnson <1024369+holocronweaver@users.noreply.github.com> Date: Sun, 29 May 2022 19:25:32 -0700 Subject: [PATCH] Do not use urllib to parse git URLs. Many valid git URLs cannot be parsed by urllib. For now, just check if git url contains service url. --- passport/case.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/passport/case.py b/passport/case.py index e7f779e..80b8703 100644 --- a/passport/case.py +++ b/passport/case.py @@ -72,13 +72,15 @@ def url_exists(config, url): # Let's see if user defined IDs match remote.origin.url def gen_candidates(ids, url): for key, value in ids.items(): - if value.get("service") == url: + service = value.get("service") + if not service: + continue + if service in url: yield (key, value) local_passports = config["git_passports"] - netloc = urllib.parse.urlparse(url)[1] - candidates = dict(gen_candidates(local_passports, netloc)) + candidates = dict(gen_candidates(local_passports, url)) if len(candidates) >= 1: msg = """