Skip to content

Commit

Permalink
Merge pull request #189 from salesforce/fix-null-default-branch
Browse files Browse the repository at this point in the history
Revert "remove explicit population of GHRepository.parent since github-api does this now"
  • Loading branch information
justinharringa authored Jan 21, 2021
2 parents b884e30 + 9c1e0c3 commit 3fbce8b
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,19 @@ public Multimap<String, GitHubContentToProcess> forkRepositoriesFoundAndGetPathT
totalContentsFound++;
parent = ghContent.getOwner();
parentRepoName = parent.getFullName();
ShouldForkResult shouldForkResult = forkableRepoValidator.shouldFork(parent, ghContent, gitForkBranch);
if (shouldForkResult.isForkable()) {
contentsShouldFork++;
// fork the parent if not already forked
ensureForkedAndAddToListForProcessing(pathToDockerfilesInParentRepo, parent, parentRepoName, ghContent);
} else {
log.warn("Skipping {} because {}", parentRepoName, shouldForkResult.getReason());
// Refresh the repo to ensure that the object has full details
try {
parent = dockerfileGitHubUtil.getRepo(parentRepoName);
ShouldForkResult shouldForkResult = forkableRepoValidator.shouldFork(parent, ghContent, gitForkBranch);
if (shouldForkResult.isForkable()) {
contentsShouldFork++;
// fork the parent if not already forked
ensureForkedAndAddToListForProcessing(pathToDockerfilesInParentRepo, parent, parentRepoName, ghContent);
} else {
log.warn("Skipping {} because {}", parentRepoName, shouldForkResult.getReason());
}
} catch (IOException exception) {
log.warn("Could not refresh details of {}", parentRepoName);
}
}

Expand Down

0 comments on commit 3fbce8b

Please sign in to comment.