@@ -21,8 +21,8 @@ type RepositoryService struct {
2121func (s * RepositoryService ) Find (ctx context.Context , repo string ) (* scm.Repository , * scm.Response , error ) {
2222 // https://docs.microsoft.com/en-us/rest/api/azure/devops/git/repositories/get?view=azure-devops-rest-4.1
2323 if s .client .project == "" {
24- return nil , nil , ProjectRequiredError ()
25- }
24+ return nil , nil , ProjectRequiredError ()
25+ }
2626 endpoint := fmt .Sprintf ("%s/%s/_apis/git/repositories/%s?api-version=6.0" , s .client .owner , s .client .project , repo )
2727
2828 out := new (repository )
@@ -59,12 +59,16 @@ func (s *RepositoryService) List2(ctx context.Context, orgSlug string, opts scm.
5959 return nil , nil , scm .ErrNotSupported
6060}
6161
62+ func (s * RepositoryService ) ListRepoLanguages (context.Context , string ) (map [string ]float64 , * scm.Response , error ) {
63+ return nil , nil , scm .ErrNotSupported
64+ }
65+
6266// ListHooks returns a list or repository hooks.
6367func (s * RepositoryService ) ListHooks (ctx context.Context , repo string , opts scm.ListOptions ) ([]* scm.Hook , * scm.Response , error ) {
6468 // https://docs.microsoft.com/en-us/rest/api/azure/devops/hooks/subscriptions/list?view=azure-devops-rest-6.0
6569 if s .client .project == "" {
66- return nil , nil , ProjectRequiredError ()
67- }
70+ return nil , nil , ProjectRequiredError ()
71+ }
6872 endpoint := fmt .Sprintf ("%s/_apis/hooks/subscriptions?api-version=6.0" , s .client .owner )
6973 out := new (subscriptions )
7074 res , err := s .client .do (ctx , "GET" , endpoint , nil , & out )
@@ -80,8 +84,8 @@ func (s *RepositoryService) ListStatus(ctx context.Context, repo, ref string, op
8084func (s * RepositoryService ) CreateHook (ctx context.Context , repo string , input * scm.HookInput ) (* scm.Hook , * scm.Response , error ) {
8185 // https://docs.microsoft.com/en-us/rest/api/azure/devops/hooks/subscriptions/create?view=azure-devops-rest-6.0
8286 if s .client .project == "" {
83- return nil , nil , ProjectRequiredError ()
84- }
87+ return nil , nil , ProjectRequiredError ()
88+ }
8589 endpoint := fmt .Sprintf ("%s/_apis/hooks/subscriptions?api-version=6.0" , s .client .owner )
8690 in := new (subscription )
8791 in .Status = "enabled"
@@ -133,8 +137,8 @@ func (s *RepositoryService) UpdateHook(ctx context.Context, repo, id string, inp
133137func (s * RepositoryService ) DeleteHook (ctx context.Context , repo , id string ) (* scm.Response , error ) {
134138 // https://docs.microsoft.com/en-us/rest/api/azure/devops/hooks/subscriptions/delete?view=azure-devops-rest-6.0
135139 if s .client .project == "" {
136- return nil , ProjectRequiredError ()
137- }
140+ return nil , ProjectRequiredError ()
141+ }
138142 endpoint := fmt .Sprintf ("%s/_apis/hooks/subscriptions/%s?api-version=6.0" , s .client .owner , id )
139143 return s .client .do (ctx , "DELETE" , endpoint , nil , nil )
140144}
0 commit comments