Skip to content

Commit 0ab6ad6

Browse files
vstinnerdiegorusso
authored andcommitted
Fix Project.repo_name for URL ending with /
1 parent e77e71d commit 0ab6ad6

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

codespeed/models.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ def repo_name(self):
5454
error = 'Not supported for %s project' % self.get_repo_type_display()
5555
raise AttributeError(error)
5656

57-
return os.path.splitext(self.repo_path.split(os.sep)[-1])[0]
57+
name = self.repo_path
58+
if name.endswith('/'):
59+
name = name[:-1]
60+
name = name.split('/')[-1]
61+
# strip extension
62+
return name.rsplit('.', 1)[0]
5863

5964
@property
6065
def working_copy(self):

0 commit comments

Comments
 (0)