Commit 428fd60e authored by Tim Olshansky's avatar Tim Olshansky

Merge pull request #90 from wikiwi/delete-branch

Add method to delete a branch
parents cc80a463 6729eb58
......@@ -911,6 +911,18 @@ public class GitlabAPI {
return Arrays.asList(branches);
}
/**
* Delete Branch.
*
* @param projectId The id of the project
* @param branchName The name of the branch to delete
* @throws IOException on gitlab api call error
*/
public void deleteBranch(Serializable projectId, String branchName) throws IOException {
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabBranch.URL + branchName;
retrieve().method("DELETE").to(tailUrl, Void.class);
}
public GitlabBranch getBranch(GitlabProject project, String branchName) throws IOException {
String tailUrl = GitlabProject.URL + "/" + project.getId() + GitlabBranch.URL + branchName;
return retrieve().to(tailUrl, GitlabBranch.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment