Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit eeebb1b

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

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

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

Lines 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)