Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eeebb1b

Browse filesBrowse files
committed
Added the 'sha' parameter.
Fixes issue hub4j#176
1 parent 63136f6 commit eeebb1b
Copy full SHA for eeebb1b

File tree

Expand file treeCollapse file tree

1 file changed

+15
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-1
lines changed

‎src/main/java/org/kohsuke/github/GHPullRequest.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHPullRequest.java
+15-1Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,21 @@ public GHPullRequestReviewComment createReviewComment(String body, String sha, S
266266
* Commit message. If null, the default one will be used.
267267
*/
268268
public void merge(String msg) throws IOException {
269-
new Requester(root).method("PUT").with("commit_message",msg).to(getApiRoute()+"/merge");
269+
merge(msg,null);
270+
}
271+
272+
/**
273+
* Merge this pull request.
274+
*
275+
* The equivalent of the big green "Merge pull request" button.
276+
*
277+
* @param msg
278+
* Commit message. If null, the default one will be used.
279+
* @param sha
280+
* SHA that pull request head must match to allow merge.
281+
*/
282+
public void merge(String msg, String sha) throws IOException {
283+
new Requester(root).method("PUT").with("commit_message",msg).with("sha",sha).to(getApiRoute()+"/merge");
270284
}
271285

272286
private void fetchIssue() throws IOException {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.