Private GIT

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

Fix issue when restoring backup from another fork and the current commit...

Fix issue when restoring backup from another fork and the current commit object is not known in our repository.
parent 6b3a2805
No related branches found
No related tags found
No related merge requests found
......@@ -759,9 +759,14 @@ class SourceUpdateManager(UpdateManager):
# try to get newest commit hash and commits behind directly by comparing branch and current commit
if self._cur_commit_hash:
try:
branch_compared = sickbeard.gh.compare(base=self.branch, head=self._cur_commit_hash)
self._newest_commit_hash = branch_compared.base_commit.sha
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
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