Skip to content

Commit

Permalink
Fix startup with git install without valid git (pymedusa#8884)
Browse files Browse the repository at this point in the history
  • Loading branch information
medariox authored and coptere committed Jan 27, 2021
1 parent d63180d commit 2939e0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion medusa/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ def initialize(self, console_logging=True):

if app.VERSION_NOTIFY:
updater = CheckVersion().updater
if updater:
if updater and updater.current_version:
app.APP_VERSION = updater.current_version

# initialize the static NZB and TORRENT providers
Expand Down
9 changes: 5 additions & 4 deletions medusa/updater/github_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@ def current_version(self):
self.update_commit_hash()
cur_version = self._run_git(self._git_path, 'describe --tags --abbrev=0 {0}'.format(
self._cur_commit_hash))[0]
return cur_version.lstrip('v')
if cur_version:
return cur_version.lstrip('v')

@property
def newest_version(self):
self.update_newest_commit_hash()
new_version = self._run_git(self._git_path, 'describe --tags --abbrev=0 {0}'.format(
self._newest_commit_hash))[0]
return new_version.lstrip('v')
if new_version:
return new_version.lstrip('v')

@property
def commits_behind(self):
Expand Down Expand Up @@ -379,8 +381,7 @@ def list_remote_branches(self):

branches, _, exit_status = self._run_git(self._git_path, 'ls-remote --heads {0}'.format(app.GIT_REMOTE))
if exit_status == 0 and branches:
if branches:
return re.findall(r'refs/heads/(.*)', branches)
return re.findall(r'refs/heads/(.*)', branches)
return []

def update_remote_origin(self):
Expand Down

0 comments on commit 2939e0a

Please sign in to comment.