Private GIT

Skip to content
Snippets Groups Projects
Commit a1adbcf0 authored by miigotu's avatar miigotu
Browse files

Merge pull request #567 from SickRage/cur-hash

Fix issue when restoring backup from another fork and the current com…
parents 6b3a2805 fb311d9a
No related branches found
No related tags found
No related merge requests found
...@@ -759,9 +759,14 @@ class SourceUpdateManager(UpdateManager): ...@@ -759,9 +759,14 @@ class SourceUpdateManager(UpdateManager):
# try to get newest commit hash and commits behind directly by comparing branch and current commit # try to get newest commit hash and commits behind directly by comparing branch and current commit
if self._cur_commit_hash: if self._cur_commit_hash:
try:
branch_compared = sickbeard.gh.compare(base=self.branch, head=self._cur_commit_hash) branch_compared = sickbeard.gh.compare(base=self.branch, head=self._cur_commit_hash)
self._newest_commit_hash = branch_compared.base_commit.sha self._newest_commit_hash = branch_compared.base_commit.sha
self._num_commits_behind = branch_compared.behind_by self._num_commits_behind = branch_compared.behind_by
except Exception: # UnknownObjectException
self._newest_commit_hash = ""
self._num_commits_behind = 0
self._cur_commit_hash = ""
# fall back and iterate over last 100 (items per page in gh_api) commits # fall back and iterate over last 100 (items per page in gh_api) commits
if not self._newest_commit_hash: if not self._newest_commit_hash:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment