'Uses pygithub to ask github if there is a newer version that the provided
commit hash. If there is a newer version it sets SickRage\'s version text.
commit_hash: hash that we\'re checking against'

def _check_github_for_update(self):

    self._num_commits_behind = 0
    self._newest_commit_hash = None
    repo = sickbeard.gh.get_organization(sickbeard.GIT_ORG).get_repo(sickbeard.GIT_REPO)
    if self._cur_commit_hash:
        try:
            branch_compared = repo.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:
            self._newest_commit_hash = u''
            self._num_commits_behind = 0
            self._cur_commit_hash = u''
    if (not self._newest_commit_hash):
        for curCommit in repo.get_commits():
            if (not self._newest_commit_hash):
                self._newest_commit_hash = curCommit.sha
                if (not self._cur_commit_hash):
                    break
            if (curCommit.sha == self._cur_commit_hash):
                break
            self._num_commits_behind += 1
    logger.log(u'cur_commit    =    {0},    newest_commit    =    {1},    num_commits_behind    =    {2}'.format(self._cur_commit_hash, self._newest_commit_hash, self._num_commits_behind), logger.DEBUG)
