Adaptation to the released GitHub API 1.45
The Kohsuke's GitHub API 1.44-SNAPSHOT did not include
all of my proposed changes: need then to adapt to
what has been included in Ver. 1.45 even by making
one extra GitHub API call (that I wanted to avoid)
to fetch the project again.
Change-Id: I803ac1dbb615366f662c2515bf0ac84d56acd820
diff --git a/github-oauth/pom.xml b/github-oauth/pom.xml
index 54c47b6..8c71b29 100644
--- a/github-oauth/pom.xml
+++ b/github-oauth/pom.xml
@@ -107,7 +107,7 @@
<dependency>
<groupId>org.kohsuke</groupId>
<artifactId>github-api</artifactId>
- <version>1.44-SNAPSHOT</version>
+ <version>1.45</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
diff --git a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/wizard/PullRequestListController.java b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/wizard/PullRequestListController.java
index 704d2b8..d9fd134 100644
--- a/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/wizard/PullRequestListController.java
+++ b/github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/wizard/PullRequestListController.java
@@ -149,8 +149,9 @@
List<GHPullRequest> repoPullRequests = Lists.newArrayList();
if (numPullRequests < config.pullRequestListLimit) {
- for (GHPullRequest ghPullRequest : GHRepository.listPullRequests(
- login.hub, ghOwner, ghRepoName, GHIssueState.OPEN)) {
+ List<GHPullRequest> pullRequests =
+ login.getMyself().getRepository(ghRepoName).getPullRequests(GHIssueState.OPEN);
+ for (GHPullRequest ghPullRequest : pullRequests) {
if (isAnyCommitOfPullRequestToBeImported(db, gitRepo,
ghPullRequest)) {