(refs #1242) Bugfix in branch protection for branches which contain /

This commit is contained in:
Naoki Takezoe
2016-07-16 11:00:29 +09:00
parent 1b85d511e9
commit 417886161c
2 changed files with 2 additions and 2 deletions

View File

@@ -39,7 +39,7 @@
<select name="protectBranch" id="protectBranch" onchange="location=$(this).val()" class="form-control">
<option>Choose a branch...</option>
@repository.branchList.map { branch =>
<option value="@helpers.url(repository)/settings/branches/@helpers.encodeRefName(branch)">@branch</option>
<option value="@helpers.url(repository)/settings/branches/@helpers.urlEncode(branch)">@branch</option>
}
</select>
<span class="error" id="error-protectBranch"></span>

View File

@@ -110,7 +110,7 @@ function submitForm(e){
var protection = getValue();
$.ajax({
method:'PATCH',
url:'@context.path/api/v3/repos/@repository.owner/@repository.name/branches/@helpers.encodeRefName(branch)',
url:'@context.path/api/v3/repos/@repository.owner/@repository.name/branches/@helpers.urlEncode(branch)',
contentType: 'application/json',
dataType: 'json',
data:JSON.stringify({protection:protection}),