Skip to content

Commit d489a11

Browse files
Michael Russellguyzmo
authored andcommitted
Check that url endswith .git rather than containing it anywhere in the
url
1 parent 5118d88 commit d489a11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git_repo/repo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,13 @@ def _guess_repo_slug(self, repository, service):
175175
if remote.name in (target, 'upstream', 'origin'):
176176
for url in remote.urls:
177177
if url.startswith('https'):
178-
if '.git' in url:
178+
if url.endswith('.git'):
179179
url = url[:-4]
180180
*_, user, name = url.split('/')
181181
self.set_repo_slug('/'.join([user, name]))
182182
break
183183
elif url.startswith('git@'):
184-
if '.git' in url:
184+
if url.endswith('.git'):
185185
url = url[:-4]
186186
_, repo_slug = url.split(':')
187187
self.set_repo_slug(repo_slug)

0 commit comments

Comments
 (0)