@@ -19,8 +19,8 @@ type contentService struct {
19
19
func (s * contentService ) Find (ctx context.Context , repo , path , ref string ) (* scm.Content , * scm.Response , error ) {
20
20
// https://docs.microsoft.com/en-us/rest/api/azure/devops/git/items/get?view=azure-devops-rest-6.0
21
21
if s .client .project == "" {
22
- return nil , nil , ProjectRequiredError ()
23
- }
22
+ return nil , nil , ProjectRequiredError ()
23
+ }
24
24
endpoint := fmt .Sprintf ("%s/%s/_apis/git/repositories/%s/items?path=%s&includeContent=true&$format=json" , s .client .owner , s .client .project , repo , path )
25
25
endpoint += generateURIFromRef (ref )
26
26
endpoint += "&api-version=6.0"
@@ -37,8 +37,8 @@ func (s *contentService) Find(ctx context.Context, repo, path, ref string) (*scm
37
37
38
38
func (s * contentService ) Create (ctx context.Context , repo , path string , params * scm.ContentParams ) (* scm.Response , error ) {
39
39
if s .client .project == "" {
40
- return nil , ProjectRequiredError ()
41
- }
40
+ return nil , ProjectRequiredError ()
41
+ }
42
42
endpoint := fmt .Sprintf ("%s/%s/_apis/git/repositories/%s/pushes?api-version=6.0" , s .client .owner , s .client .project , repo )
43
43
ref := refUpdate {
44
44
Name : SanitizeBranchName (params .Branch ),
@@ -66,8 +66,8 @@ func (s *contentService) Create(ctx context.Context, repo, path string, params *
66
66
67
67
func (s * contentService ) Update (ctx context.Context , repo , path string , params * scm.ContentParams ) (* scm.Response , error ) {
68
68
if s .client .project == "" {
69
- return nil , ProjectRequiredError ()
70
- }
69
+ return nil , ProjectRequiredError ()
70
+ }
71
71
endpoint := fmt .Sprintf ("%s/%s/_apis/git/repositories/%s/pushes?api-version=6.0" , s .client .owner , s .client .project , repo )
72
72
ref := refUpdate {
73
73
Name : SanitizeBranchName (params .Branch ),
@@ -95,8 +95,8 @@ func (s *contentService) Update(ctx context.Context, repo, path string, params *
95
95
96
96
func (s * contentService ) Delete (ctx context.Context , repo , path string , params * scm.ContentParams ) (* scm.Response , error ) {
97
97
if s .client .project == "" {
98
- return nil , ProjectRequiredError ()
99
- }
98
+ return nil , ProjectRequiredError ()
99
+ }
100
100
endpoint := fmt .Sprintf ("%s/%s/_apis/git/repositories/%s/pushes?api-version=6.0" , s .client .owner , s .client .project , repo )
101
101
ref := refUpdate {
102
102
Name : SanitizeBranchName (params .Branch ),
@@ -122,9 +122,9 @@ func (s *contentService) Delete(ctx context.Context, repo, path string, params *
122
122
func (s * contentService ) List (ctx context.Context , repo , path , ref string , _ scm.ListOptions ) ([]* scm.ContentInfo , * scm.Response , error ) {
123
123
// https://docs.microsoft.com/en-us/rest/api/azure/devops/git/items/list?view=azure-devops-rest-6.0
124
124
if s .client .project == "" {
125
- return nil , nil , ProjectRequiredError ()
126
- }
127
- endpoint := fmt .Sprintf ("%s/%s/_apis/git/repositories/%s/items?path =%s&recursionLevel=Full&$format=json" , s .client .owner , s .client .project , repo , path )
125
+ return nil , nil , ProjectRequiredError ()
126
+ }
127
+ endpoint := fmt .Sprintf ("%s/%s/_apis/git/repositories/%s/items?scopePath =%s&recursionLevel=Full&$format=json" , s .client .owner , s .client .project , repo , path )
128
128
endpoint += generateURIFromRef (ref )
129
129
out := new (contentList )
130
130
res , err := s .client .do (ctx , "GET" , endpoint , nil , & out )
0 commit comments