aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/xanzy/go-gitlab/protected_branches.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/xanzy/go-gitlab/protected_branches.go')
-rw-r--r--vendor/github.com/xanzy/go-gitlab/protected_branches.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/vendor/github.com/xanzy/go-gitlab/protected_branches.go b/vendor/github.com/xanzy/go-gitlab/protected_branches.go
index 4950ecc2..3567f6eb 100644
--- a/vendor/github.com/xanzy/go-gitlab/protected_branches.go
+++ b/vendor/github.com/xanzy/go-gitlab/protected_branches.go
@@ -18,6 +18,7 @@ package gitlab
import (
"fmt"
+ "net/url"
)
// ProtectedBranchesService handles communication with the protected branch
@@ -90,7 +91,7 @@ func (s *ProtectedBranchesService) GetProtectedBranch(pid interface{}, branch st
if err != nil {
return nil, nil, err
}
- u := fmt.Sprintf("projects/%s/protected_branches/%s", pathEscape(project), branch)
+ u := fmt.Sprintf("projects/%s/protected_branches/%s", pathEscape(project), url.PathEscape(branch))
req, err := s.client.NewRequest("GET", u, nil, options)
if err != nil {
@@ -153,7 +154,7 @@ func (s *ProtectedBranchesService) UnprotectRepositoryBranches(pid interface{},
if err != nil {
return nil, err
}
- u := fmt.Sprintf("projects/%s/protected_branches/%s", pathEscape(project), branch)
+ u := fmt.Sprintf("projects/%s/protected_branches/%s", pathEscape(project), url.PathEscape(branch))
req, err := s.client.NewRequest("DELETE", u, nil, options)
if err != nil {