Skip to content

Commit

Permalink
hub4j#1967 Modified rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
sbouchexbellomie-Philips committed Oct 15, 2024
1 parent 6862fa2 commit 3209cf4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/kohsuke/github/GHBranch.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ public GHCommit merge(String head, String commitMessage) throws IOException {
* @see https://docs.github.com/en/rest/branches/branches?apiVersion=2022-11-28#rename-a-branch
*/
public GHBranch rename(String name) throws IOException {
root().createRequest().method("POST").with("new_name", name).withUrlPath(getApiRoute() + "/rename").send();
return root().createRequest().method("POST").with("new_name", name)
.withUrlPath(getApiRoute() + "/rename")
.fetch(GHBranch.class);
}

/**
Expand Down

0 comments on commit 3209cf4

Please sign in to comment.