@@ -112,8 +112,7 @@ public Branch createBranch(Integer projectId, String branchName, String ref) thr
112
112
113
113
114
114
/**
115
- * Delete a single project repository branch. This is an idempotent function,
116
- * protecting an already protected repository branch will not produce an error.
115
+ * Delete a single project repository branch.
117
116
*
118
117
* DELETE /projects/:id/repository/branches/:branch
119
118
*
@@ -138,7 +137,7 @@ public void deleteBranch(Integer projectId, String branchName) throws GitLabApiE
138
137
* @throws GitLabApiException if any exception occurs
139
138
*/
140
139
public Branch protectBranch (Integer projectId , String branchName ) throws GitLabApiException {
141
- Response response = put (Response .Status .OK , null , "projects" , projectId , "repository" , "branches" , branchName , "protect" );
140
+ Response response = put (Response .Status .OK , null , "projects" , projectId , "repository" , "branches" , urlEncode ( branchName ) , "protect" );
142
141
return (response .readEntity (Branch .class ));
143
142
}
144
143
@@ -154,7 +153,7 @@ public Branch protectBranch(Integer projectId, String branchName) throws GitLabA
154
153
* @throws GitLabApiException if any exception occurs
155
154
*/
156
155
public Branch unprotectBranch (Integer projectId , String branchName ) throws GitLabApiException {
157
- Response response = put (Response .Status .OK , null , "projects" , projectId , "repository" , "branches" , branchName , "unprotect" );
156
+ Response response = put (Response .Status .OK , null , "projects" , projectId , "repository" , "branches" , urlEncode ( branchName ) , "unprotect" );
158
157
return (response .readEntity (Branch .class ));
159
158
}
160
159
0 commit comments