# HG changeset patch # User Mads Kiilerich # Date 1563272710 -7200 # Node ID dbf3c33a516cee3fc9e76950019d908938b6260c # Parent ca8f597c8fa89326ba72125280872913e6575fe6 clone_url: simplify stripping of 'username@' from URLs when username is empty diff -r ca8f597c8fa8 -r dbf3c33a516c kallithea/lib/utils2.py --- a/kallithea/lib/utils2.py Wed Jul 31 02:29:36 2019 +0200 +++ b/kallithea/lib/utils2.py Tue Jul 16 12:25:10 2019 +0200 @@ -426,9 +426,10 @@ # remove leading @ sign if it's present. Case of empty user url_obj = urlobject.URLObject(url) - url = url_obj.with_netloc(url_obj.netloc.lstrip('@')) + if not url_obj.username: + url_obj = url_obj.with_username(None) - return safe_unicode(url) + return safe_unicode(url_obj) def get_changeset_safe(repo, rev):