@@ -153,7 +153,7 @@ public List<GHIssue> getIssues(GHIssueState state) throws IOException {
153153 public List <GHIssue > getIssues (GHIssueState state , GHMilestone milestone ) throws IOException {
154154 return Arrays .asList (GHIssue .wrap (root .retrieve ()
155155 .to (String .format ("/repos/%s/%s/issues?state=%s&milestone=%s" , owner .login , name ,
156- state .toString ().toLowerCase (), milestone == null ? "none" : "" + milestone .getNumber ()),
156+ state .toString ().toLowerCase (), milestone == null ? "none" : "" + milestone .getNumber ()),
157157 GHIssue [].class
158158 ), this ));
159159 }
@@ -469,6 +469,29 @@ protected void wrapUp(GHPullRequest[] page) {
469469 };
470470 }
471471
472+ /**
473+ * Creates a new pull request.
474+ *
475+ * @param title
476+ * Required. The title of the pull request.
477+ * @param head
478+ * Required. The name of the branch where your changes are implemented.
479+ * For cross-repository pull requests in the same network,
480+ * namespace head with a user like this: username:branch.
481+ * @param base
482+ * Required. The name of the branch you want your changes pulled into.
483+ * This should be an existing branch on the current repository.
484+ * @param body
485+ * The contents of the pull request. This is the markdown description
486+ * of a pull request.
487+ */
488+ public GHPullRequest createPullRequest (String title , String head , String base , String body ) throws IOException {
489+ return new Requester (root ).with ("title" ,title )
490+ .with ("head" ,head )
491+ .with ("base" ,base )
492+ .with ("body" ,body ).to (getApiTailUrl ("pulls" ),GHPullRequest .class ).wrapUp (this );
493+ }
494+
472495 /**
473496 * Retrieves the currently configured hooks.
474497 */
@@ -498,7 +521,7 @@ public GHCompare getCompare(String id1, String id2) throws IOException {
498521 }
499522
500523 public GHCompare getCompare (GHCommit id1 , GHCommit id2 ) throws IOException {
501- return getCompare (id1 .getSHA1 (),id2 .getSHA1 ());
524+ return getCompare (id1 .getSHA1 (), id2 .getSHA1 ());
502525 }
503526
504527 public GHCompare getCompare (GHBranch id1 , GHBranch id2 ) throws IOException {
0 commit comments