Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwiseman committed Jul 17, 2020
1 parent f7b3a48 commit d6759dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,9 @@ public List<BitbucketPullRequestValue> getPullRequests() throws InterruptedExcep
pullRequests.addAll(page.getValues());
} while (page.getNext() != null);

// PRs with missing destination branch are invalid and should be ignored.
// PRs with missing source or destination branch are invalid and should be ignored.
pullRequests.removeIf(pr -> pr.getSource().getRepository() == null
|| pr.getSource().getBranch() == null
|| pr.getSource().getCommit() == null
|| pr.getDestination().getBranch() == null
|| pr.getDestination().getCommit() == null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ private void reconstructMissingData() {
}
}
}
}
if (source != null) {

BitbucketCloudBranch sourceBranch = source.getBranch();
BitbucketCommit sourceCommit = source.getCommit();
if (sourceCommit != null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,12 @@ private List<BitbucketServerPullRequest> getPullRequests(UriTemplate template)
throws IOException, InterruptedException {
List<BitbucketServerPullRequest> pullRequests = getResources(template, BitbucketServerPullRequests.class);

// PRs with missing destination branch are invalid and should be ignored.
// PRs with missing source or destination branch are invalid and should be ignored.
pullRequests.removeIf(pr -> pr.getSource().getRepository() == null
|| pr.getSource().getBranch() == null
|| pr.getDestination().getBranch() == null);
|| pr.getSource().getCommit() == null
|| pr.getDestination().getBranch() == null
|| pr.getDestination().getCommit() == null);

// set commit closure to make commit informations available when need, in a similar way to when request branches
for (BitbucketServerPullRequest pullRequest : pullRequests) {
Expand Down

0 comments on commit d6759dc

Please sign in to comment.