Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-47775] Respect contract for a single PR fetyche when t…
…he PR is closed
  • Loading branch information
stephenc committed Nov 1, 2017
1 parent 498d800 commit 523a8fb
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -1662,7 +1662,11 @@ protected Iterable<GHPullRequest> create() {
if (prs != null && prs.size() == 1) {
Integer number = prs.iterator().next();
request.listener().getLogger().format("%n Getting remote pull request #%d...%n", number);
return new CacheUdatingIterable(Collections.singletonList(repo.getPullRequest(number)));
GHPullRequest pullRequest = repo.getPullRequest(number);
if (pullRequest.getState() != GHIssueState.OPEN) {
return Collections.emptyList();
}
return new CacheUdatingIterable(Collections.singletonList(pullRequest));
}
Set<String> branchNames = request.getRequestedOriginBranchNames();
if (branchNames != null && branchNames.size() == 1) { // TODO flag to check PRs are all origin PRs
Expand Down

0 comments on commit 523a8fb

Please sign in to comment.