Skip to content

Commit 315e6e5

Browse files
hub4j#1967 Adding rename method
1 parent 768c715 commit 315e6e5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

+13
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,19 @@ public GHCommit merge(String head, String commitMessage) throws IOException {
192192
return result;
193193
}
194194

195+
/**
196+
* Rename this branch.
197+
*
198+
* @param name
199+
* the name
200+
* @throws IOException
201+
* the io exception
202+
*/
203+
@CheckForNull
204+
public void rename(String name) throws IOException {
205+
root().createRequest().method("POST").with("new_name", name).withUrlPath(getApiRoute() + "/rename").send();
206+
}
207+
195208
/**
196209
* Gets the api route.
197210
*

0 commit comments

Comments
 (0)