From 3209cf4835ccbe250ff6c0d5d7cd843db9426740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Bouchex=20Bellomi=C3=A9?= Date: Tue, 15 Oct 2024 08:30:48 +0200 Subject: [PATCH] #1967 Modified rename method --- src/main/java/org/kohsuke/github/GHBranch.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/kohsuke/github/GHBranch.java b/src/main/java/org/kohsuke/github/GHBranch.java index 0f648be857..1db9801eb5 100644 --- a/src/main/java/org/kohsuke/github/GHBranch.java +++ b/src/main/java/org/kohsuke/github/GHBranch.java @@ -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); } /**