From 251de6b868299b2253dc74449fc1124ad814c40d Mon Sep 17 00:00:00 2001 From: Greg Messner Date: Mon, 25 Feb 2019 00:38:30 -0800 Subject: [PATCH] Added deleteMergedBranches() (#312). --- src/main/java/org/gitlab4j/api/RepositoryApi.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/org/gitlab4j/api/RepositoryApi.java b/src/main/java/org/gitlab4j/api/RepositoryApi.java index 1fd6087f..a8346e93 100644 --- a/src/main/java/org/gitlab4j/api/RepositoryApi.java +++ b/src/main/java/org/gitlab4j/api/RepositoryApi.java @@ -779,4 +779,18 @@ public class RepositoryApi extends AbstractApi { return (GitLabApi.createOptionalFromException(glae)); } } + + /** + *

Delete all branches that are merged into the project’s default branch.GitLab Endpoint: /projects/:id/repository/merged_branches + * + * @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance + * @throws GitLabApiException if any exception occurs + */ + public void deleteMergedBranches(Object projectIdOrPath) throws GitLabApiException { + delete(Response.Status.NO_CONTENT, null, "projects", + getProjectIdOrPath(projectIdOrPath), "repository", "merged_branches"); + } } -- GitLab