Skip to content

Commit 251de6b

Browse files
committed
Added deleteMergedBranches() (#312).
1 parent 34a723b commit 251de6b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/main/java/org/gitlab4j/api/RepositoryApi.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,4 +779,18 @@ public Optional<Commit> getOptionalMergeBase(Object projectIdOrPath, List<String
779779
return (GitLabApi.createOptionalFromException(glae));
780780
}
781781
}
782+
783+
/**
784+
* <p>Delete all branches that are merged into the project’s default branch.</p?
785+
* NOTE: Protected branches will not be deleted as part of this operation.
786+
*
787+
* <pre><code>GitLab Endpoint: /projects/:id/repository/merged_branches</code></pre>
788+
*
789+
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
790+
* @throws GitLabApiException if any exception occurs
791+
*/
792+
public void deleteMergedBranches(Object projectIdOrPath) throws GitLabApiException {
793+
delete(Response.Status.NO_CONTENT, null, "projects",
794+
getProjectIdOrPath(projectIdOrPath), "repository", "merged_branches");
795+
}
782796
}

0 commit comments

Comments
 (0)