From 4609310d43fd4bc51b55230b99a6aa1480876684 Mon Sep 17 00:00:00 2001 From: Maciej Katafiasz Date: Thu, 28 Nov 2024 11:10:30 -0800 Subject: [PATCH] Properly apply platform defaults when parsing --- giturlparse/parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/giturlparse/parser.py b/giturlparse/parser.py index f2c99e2..0514e38 100644 --- a/giturlparse/parser.py +++ b/giturlparse/parser.py @@ -52,7 +52,8 @@ def parse(url, check_domain=True): parsed_info.update(platform.DEFAULTS) # Get matches as dictionary - matches = platform.clean_data(match.groupdict(default="")) + matches = platform.clean_data({k: v if v is not None else platform.DEFAULTS.get(k, "") + for k, v in match.groupdict().items()}) # Update info with matches parsed_info.update(matches)