#222 - Encode branch name on requests to avoid errors with special chars
This commit is contained in:
parent
679634afec
commit
471b26a9d5
@ -331,20 +331,20 @@ export default class API {
|
||||
}
|
||||
|
||||
patchRef(type, name, sha) {
|
||||
return this.request(`${ this.repoURL }/git/refs/${ type }/${ name }`, {
|
||||
return this.request(`${ this.repoURL }/git/refs/${ type }/${ encodeURIComponent(name) }`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify({ sha }),
|
||||
});
|
||||
}
|
||||
|
||||
deleteRef(type, name, sha) {
|
||||
return this.request(`${ this.repoURL }/git/refs/${ type }/${ name }`, {
|
||||
return this.request(`${ this.repoURL }/git/refs/${ type }/${ encodeURIComponent(name) }`, {
|
||||
method: "DELETE",
|
||||
});
|
||||
}
|
||||
|
||||
getBranch(branch = this.branch) {
|
||||
return this.request(`${ this.repoURL }/branches/${ branch }`);
|
||||
return this.request(`${ this.repoURL }/branches/${ encodeURIComponent(branch) }`);
|
||||
}
|
||||
|
||||
createBranch(branchName, sha) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user