diff --git a/wakatime/projects/git.py b/wakatime/projects/git.py index ea38cb6..90a12b6 100644 --- a/wakatime/projects/git.py +++ b/wakatime/projects/git.py @@ -43,8 +43,9 @@ class Git(BaseProject): sections = self._parse_config() for section in sections: if section.split(' ', 1)[0] == 'remote' and 'url' in sections[section]: - remote = sections[section]['url'].rsplit(':', 1)[1].rsplit('/', 1)[1].split('.git', 1)[0] - tags.append(remote) + remote = sections[section]['url'].rsplit(':', 1)[-1].rsplit('/', 1)[-1].split('.git', 1)[0] + if remote: + tags.append(remote) branch = self._current_branch() if branch is not None: tags.append(branch)