mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-04 15:50:52 +00:00
Massaging the pull request.
- GHPerson really should be an abstract class - static listPullRequests method does not fit the design of this library, although I'm very sympathetic as to why Luca wanted to do it. Nonetheless I'm removing this in favor of the lazy loading of the state to avoid unnecessary calls in the future.
This commit is contained in:
@@ -14,7 +14,7 @@ import java.util.TreeMap;
|
||||
*
|
||||
* @author Kohsuke Kawaguchi
|
||||
*/
|
||||
public class GHPerson {
|
||||
public abstract class GHPerson {
|
||||
/*package almost final*/ GitHub root;
|
||||
|
||||
// core data fields that exist even for "small" user data (such as the user info in pull request)
|
||||
@@ -235,5 +235,4 @@ public class GHPerson {
|
||||
populate();
|
||||
return followers;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class GHRepository {
|
||||
private String description, homepage, name;
|
||||
private String url; // this is the API url
|
||||
private String html_url; // this is the UI
|
||||
private GHPerson owner; // not fully populated. beware.
|
||||
private GHUser owner; // not fully populated. beware.
|
||||
private boolean has_issues, has_wiki, fork, _private, has_downloads;
|
||||
private int watchers,forks,open_issues,size;
|
||||
private String created_at, pushed_at;
|
||||
@@ -378,17 +378,6 @@ public class GHRepository {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all the pull requests of a particular state by knowing organisation and repository
|
||||
*/
|
||||
public static PagedIterable<GHPullRequest> listPullRequests(final GitHub root, final GHPerson owner, final String repositoryName, final GHIssueState state) {
|
||||
GHRepository repo = new GHRepository();
|
||||
repo.root = root;
|
||||
repo.name = repositoryName;
|
||||
repo.owner = owner;
|
||||
return repo.listPullRequests(state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the currently configured hooks.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user