Skip to content

Commit

Permalink
Handle the possibility that the URL already ends with '/'
Browse files Browse the repository at this point in the history
From some testing, I don't think it's essential that we avoid a double
slash, but this is needed for unit tests to pass, and leads to cleaner
URLs.
  • Loading branch information
billsacks committed Apr 7, 2022
1 parent 02ea87e commit eb7fc13
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions manic/repository_svn.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,15 @@ def __init__(self, component_name, repo, ignore_ancestry=False):
"""
Repository.__init__(self, component_name, repo)
self._ignore_ancestry = ignore_ancestry
if self._url.endswith('/'):
# there is already a '/' separator in the URL; no need to add another
url_sep = ''
else:
url_sep = '/'
if self._branch:
self._url = self._url + '/' + self._branch
self._url = self._url + url_sep + self._branch
elif self._tag:
self._url = self._url + '/' + self._tag
self._url = self._url + url_sep + self._tag
else:
msg = "DEV_ERROR in svn repository. Shouldn't be here!"
fatal_error(msg)
Expand Down

0 comments on commit eb7fc13

Please sign in to comment.