diff --git a/src/main/java/org/kohsuke/github/GHBranch.java b/src/main/java/org/kohsuke/github/GHBranch.java index f803c67e70..e9e1f4f9f9 100644 --- a/src/main/java/org/kohsuke/github/GHBranch.java +++ b/src/main/java/org/kohsuke/github/GHBranch.java @@ -192,6 +192,19 @@ public GHCommit merge(String head, String commitMessage) throws IOException { return result; } + /** + * Rename this branch. + * + * @param name + * the name + * @throws IOException + * the io exception + */ + @CheckForNull + public void rename(String name) throws IOException { + root().createRequest().method("POST").with("new_name", name).withUrlPath(getApiRoute() + "/rename").send(); + } + /** * Gets the api route. *