Skip to content

Commit 3209cf4

Browse files
hub4j#1967 Modified rename method
1 parent 6862fa2 commit 3209cf4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ public GHCommit merge(String head, String commitMessage) throws IOException {
202202
* @see https://docs.github.com/en/rest/branches/branches?apiVersion=2022-11-28#rename-a-branch
203203
*/
204204
public GHBranch rename(String name) throws IOException {
205-
root().createRequest().method("POST").with("new_name", name).withUrlPath(getApiRoute() + "/rename").send();
205+
return root().createRequest().method("POST").with("new_name", name)
206+
.withUrlPath(getApiRoute() + "/rename")
207+
.fetch(GHBranch.class);
206208
}
207209

208210
/**

0 commit comments

Comments
 (0)