fix: handle empty repo

This commit is contained in:
tdurieux
2022-10-04 11:11:02 +02:00
parent 2080a04021
commit 85ab24f369

View File

@@ -93,9 +93,11 @@ export default class GitHubStream extends GitHubBase implements SourceBase {
});
} catch (error) {
if (error.status == 409) {
console.log(error.stack);
// empty tree
ghRes = { data: { tree: [], truncated: false } };
if (this.repository.status != "ready")
await this.repository.updateStatus("ready");
// cannot be empty otherwise it would try to download it again
return { __: {} };
} else {
await this.repository.resetSate("error", "repo_not_accessible");
throw new AnonymousError("repo_not_accessible", {