Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unprotect branches with delete #634 Fixed #1112

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/org/gitlab4j/api/RepositoryApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,15 @@ public Branch protectBranch(Object projectIdOrPath, String branchName) throws Gi
* Unprotects a single project repository branch. This is an idempotent function, unprotecting an
* already unprotected repository branch will not produce an error.
*
* <pre><code>GitLab Endpoint: PUT /projects/:id/repository/branches/:branch/unprotect</code></pre>
* <pre><code>GitLab Endpoint: DELETE /projects/:id/repository/branches/:branch/unprotect</code></pre>
*
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance
* @param branchName the name of the branch to un-protect
* @return the branch info for the unprotected branch
* @throws GitLabApiException if any exception occurs
*/
public Branch unprotectBranch(Object projectIdOrPath, String branchName) throws GitLabApiException {
Response response = put(Response.Status.OK, null, "projects",
Response response = delete(Response.Status.OK, null, "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "branches", urlEncode(branchName), "unprotect");
return (response.readEntity(Branch.class));
}
Expand Down
Loading