public Branch protectBranch ( Object projectIdOrPath , String branchName ) throws GitLabApiException { Response response = put ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "repository" , "branches" , urlEncode ( branchName ) , "protect" ) ; return ( response . readEntity ( Branch . class ) ) ; }
Protects a single project repository branch . This is an idempotent function protecting an already protected repository branch will not produce an error .