detect empty repository

This commit is contained in:
tdurieux
2019-05-14 16:47:21 +01:00
parent 55d168f910
commit b8be034711
3 changed files with 63 additions and 4 deletions

View File

@@ -391,7 +391,11 @@ class Anonymous_Github:
repository_configuration = json.load(f)
(username, repo, branch) = clean_github_repository(repository_configuration['repository'])
g_repo = self.github.get_repo("%s/%s" % (username, repo))
g_commit = g_repo.get_commit(branch)
g_commit = None
try:
g_commit = g_repo.get_commit(branch)
except:
return render_template('empty.html'), 404
if not is_up_to_date(repository_configuration, g_commit):
if os.path.exists(os.path.join(repo_path, "cache")):