Skip to content

Commit

Permalink
Merge branch 'master' into ghapiv4-2-run-concurrently
Browse files Browse the repository at this point in the history
  • Loading branch information
lourot committed Jan 16, 2019
2 parents d12f1e1 + 278128c commit 0f5a0a6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions fetchRepos.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,15 @@ optional arguments:

if (!repo.fetching_since || repo.fetched_at &&
new Date(repo.fetched_at) > new Date(repo.pushed_at)) {
console.log(`${tag} hasn't changed`);
return;

if (repo.size && !repoCommits.last_fetched_commit.sha) {
// This is fishy because the repo isn't empty but we didn't manage to fetch any commit
// last time. We definitely need to try again.
} else {
console.log(`${tag} hasn't changed`);
return;
}

}

const now = new Date;
Expand Down Expand Up @@ -337,6 +344,10 @@ optional arguments:
repo.write();
repoCommits.last_fetched_commit = mostRecentCommit || repoCommits.last_fetched_commit;
repoCommits.write();

if (repo.size && !repoCommits.last_fetched_commit.sha) {
throw `${repo.full_name} is not empty yet has no commits?`;
}
}

async function fetchRepoPullRequests(ghcl, repo) {
Expand Down

0 comments on commit 0f5a0a6

Please sign in to comment.