Skip to content

Commit

Permalink
Add to README.
Browse files Browse the repository at this point in the history
  • Loading branch information
gailazar300 committed Jun 22, 2024
1 parent 9d2d2e5 commit 780df79
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Currently supported providers are: [GitHub](#github), [Bitbucket Server](#bitbuc
- [Delete Pull Request Comment](#delete-pull-request-comment)
- [Delete Pull Request Review Comments](#delete-pull-request-review-comments)
- [Get Commits](#get-commits)
- [Get Commits With Options](#get-commits-with-options)
- [Get Latest Commit](#get-latest-commit)
- [Get Commit By SHA](#get-commit-by-sha)
- [Get List of Modified Files](#get-list-of-modified-files)
Expand Down Expand Up @@ -544,6 +545,29 @@ branch := "dev"
commitInfo, err := client.GetCommits(ctx, owner, repository, branch)
```

#### Get Commits With Options

```go
// Go context
ctx := context.Background()
// Organization or username
owner := "jfrog"
// VCS repository
repository := "jfrog-cli"

// Commits query options
options := GitCommitsQueryOptions{
Since: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC),
Until: time.Now(),
ListOptions: ListOptions{
Page: 1,
PerPage: 30,
},
}

result, err := client.GetCommitsWithQueryOptions(ctx, owner, repository, options)
```

#### Get Latest Commit

```go
Expand Down

0 comments on commit 780df79

Please sign in to comment.