Skip to content

Commit 6412396

Browse files
kounoikeguyzmo
authored andcommitted
💄 Minor improvements of the slug detection code
1 parent 0300d57 commit 6412396

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

git_repo/repo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ def _guess_repo_slug(self, repository, service, resolve_targets=None):
165165
for url in remote.urls:
166166
if url.endswith('.git'):
167167
url = url[:-4]
168-
if url.find('://') > -1:
169-
# http://, https:// and ssh://
168+
# strip http://, https:// and ssh://
169+
if '://' in url:
170170
*_, user, name = url.split('/')
171171
self.set_repo_slug('/'.join([user, name]))
172172
return
173-
elif url.find('@') > -1 and url.find(':') > -1:
174-
# scp-style URL
173+
# scp-style URL
174+
elif '@' in url and ':' in url:
175175
_, repo_slug = url.split(':')
176176
self.set_repo_slug(repo_slug)
177177
return

0 commit comments

Comments
 (0)