Commit 266c87ba authored by Zaq? Wiedmann's avatar Zaq? Wiedmann Committed by Sander van Harmelen

(branches) fix #233, urlencode branch name (#298)

parent ec65bc79
...@@ -88,7 +88,7 @@ func (s *BranchesService) GetBranch(pid interface{}, branch string, options ...O ...@@ -88,7 +88,7 @@ func (s *BranchesService) GetBranch(pid interface{}, branch string, options ...O
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
u := fmt.Sprintf("projects/%s/repository/branches/%s", url.QueryEscape(project), branch) u := fmt.Sprintf("projects/%s/repository/branches/%s", url.QueryEscape(project), url.QueryEscape(branch))
req, err := s.client.NewRequest("GET", u, nil, options) req, err := s.client.NewRequest("GET", u, nil, options)
if err != nil { if err != nil {
...@@ -124,7 +124,7 @@ func (s *BranchesService) ProtectBranch(pid interface{}, branch string, opts *Pr ...@@ -124,7 +124,7 @@ func (s *BranchesService) ProtectBranch(pid interface{}, branch string, opts *Pr
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
u := fmt.Sprintf("projects/%s/repository/branches/%s/protect", url.QueryEscape(project), branch) u := fmt.Sprintf("projects/%s/repository/branches/%s/protect", url.QueryEscape(project), url.QueryEscape(branch))
req, err := s.client.NewRequest("PUT", u, opts, options) req, err := s.client.NewRequest("PUT", u, opts, options)
if err != nil { if err != nil {
...@@ -151,7 +151,7 @@ func (s *BranchesService) UnprotectBranch(pid interface{}, branch string, option ...@@ -151,7 +151,7 @@ func (s *BranchesService) UnprotectBranch(pid interface{}, branch string, option
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
u := fmt.Sprintf("projects/%s/repository/branches/%s/unprotect", url.QueryEscape(project), branch) u := fmt.Sprintf("projects/%s/repository/branches/%s/unprotect", url.QueryEscape(project), url.QueryEscape(branch))
req, err := s.client.NewRequest("PUT", u, nil, options) req, err := s.client.NewRequest("PUT", u, nil, options)
if err != nil { if err != nil {
...@@ -210,7 +210,7 @@ func (s *BranchesService) DeleteBranch(pid interface{}, branch string, options . ...@@ -210,7 +210,7 @@ func (s *BranchesService) DeleteBranch(pid interface{}, branch string, options .
if err != nil { if err != nil {
return nil, err return nil, err
} }
u := fmt.Sprintf("projects/%s/repository/branches/%s", url.QueryEscape(project), branch) u := fmt.Sprintf("projects/%s/repository/branches/%s", url.QueryEscape(project), url.QueryEscape(branch))
req, err := s.client.NewRequest("DELETE", u, nil, options) req, err := s.client.NewRequest("DELETE", u, nil, options)
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment