diff options
Diffstat (limited to 'vendor/github.com/xanzy/go-gitlab/commits.go')
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/commits.go | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/vendor/github.com/xanzy/go-gitlab/commits.go b/vendor/github.com/xanzy/go-gitlab/commits.go index 4bf067e8..cb03c3a0 100644 --- a/vendor/github.com/xanzy/go-gitlab/commits.go +++ b/vendor/github.com/xanzy/go-gitlab/commits.go @@ -18,6 +18,7 @@ package gitlab import ( "fmt" + "net/url" "time" ) @@ -150,7 +151,7 @@ func (s *CommitsService) GetCommitRefs(pid interface{}, sha string, opt *GetComm if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/refs", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/refs", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, opt, options) if err != nil { @@ -175,7 +176,7 @@ func (s *CommitsService) GetCommit(pid interface{}, sha string, options ...Optio if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, nil, options) if err != nil { @@ -260,7 +261,7 @@ func (s *CommitsService) GetCommitDiff(pid interface{}, sha string, opt *GetComm if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/diff", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/diff", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, opt, options) if err != nil { @@ -317,7 +318,7 @@ func (s *CommitsService) GetCommitComments(pid interface{}, sha string, opt *Get if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/comments", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/comments", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, opt, options) if err != nil { @@ -356,7 +357,7 @@ func (s *CommitsService) PostCommitComment(pid interface{}, sha string, opt *Pos if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/comments", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/comments", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("POST", u, opt, options) if err != nil { @@ -408,7 +409,7 @@ func (s *CommitsService) GetCommitStatuses(pid interface{}, sha string, opt *Get if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/statuses", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/statuses", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, opt, options) if err != nil { @@ -444,7 +445,7 @@ func (s *CommitsService) SetCommitStatus(pid interface{}, sha string, opt *SetCo if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/statuses/%s", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/statuses/%s", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("POST", u, opt, options) if err != nil { @@ -469,7 +470,7 @@ func (s *CommitsService) GetMergeRequestsByCommit(pid interface{}, sha string, o if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/merge_requests", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/merge_requests", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, nil, options) if err != nil { @@ -500,7 +501,7 @@ func (s *CommitsService) CherryPickCommit(pid interface{}, sha string, opt *Cher if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/cherry_pick", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/cherry_pick", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("POST", u, opt, options) if err != nil { @@ -531,7 +532,7 @@ func (s *CommitsService) RevertCommit(pid interface{}, sha string, opt *RevertCo if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/revert", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/revert", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("POST", u, opt, options) if err != nil { @@ -568,7 +569,7 @@ func (s *CommitsService) GetGPGSiganature(pid interface{}, sha string, options . if err != nil { return nil, nil, err } - u := fmt.Sprintf("projects/%s/repository/commits/%s/signature", pathEscape(project), sha) + u := fmt.Sprintf("projects/%s/repository/commits/%s/signature", pathEscape(project), url.PathEscape(sha)) req, err := s.client.NewRequest("GET", u, nil, options) if err != nil { |