Skip to content

Commit

Permalink
hub4j#1967 Adding rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
sbouchexbellomie-Philips committed Oct 3, 2024
1 parent 768c715 commit 315e6e5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/org/kohsuke/github/GHBranch.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit 315e6e5

Please sign in to comment.