Skip to content

Commit 5fc5788

Browse files
authored
Added max-depth to the ListFiles function. (ktrysmt#200)
1 parent 584c8d0 commit 5fc5788

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

bitbucket.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ type RepositoryFilesOptions struct {
179179
RepoSlug string `json:"repo_slug"`
180180
Ref string `json:"ref"`
181181
Path string `json:"path"`
182+
MaxDepth int `json:"max_depth"`
182183
}
183184

184185
type RepositoryBlobOptions struct {

repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ func (r *Repository) ListFiles(ro *RepositoryFilesOptions) ([]RepositoryFile, er
253253
}
254254

255255
query := url.Query()
256-
r.c.addMaxDepthParam(&query, nil)
256+
r.c.addMaxDepthParam(&query, &ro.MaxDepth)
257257
url.RawQuery = query.Encode()
258258

259259
urlStr = url.String()

0 commit comments

Comments
 (0)