-
Notifications
You must be signed in to change notification settings - Fork 474
Add a variation of the getCommits method that supports Paging and a path #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a variation of the getCommits method that supports Paging and a path #167
Conversation
Simple variation to make it easy to find all commits for a given file.
@@ -180,6 +180,29 @@ public CommitsApi(GitLabApi gitLabApi) { | |||
return (new Pager<Commit>(this, Commit.class, itemsPerPage, formData.asMap(), "projects", projectId, "repository", "commits")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also modify this method to call the new one that I added, with null for the path, if you would prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this would be a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@swilson11
|
* @return a Pager containing the commits for the specified project ID | ||
* @throws GitLabApiException GitLabApiException if any exception occurs during execution | ||
*/ | ||
public Pager<Commit> getCommits(int projectId, String ref, Date since, Date until, int itemsPerPage, String path) throws GitLabApiException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move the path
param before the itemsPerPage
param? The itemsPerPage
param should always be last.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -180,6 +180,29 @@ public CommitsApi(GitLabApi gitLabApi) { | |||
return (new Pager<Commit>(this, Commit.class, itemsPerPage, formData.asMap(), "projects", projectId, "repository", "commits")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this would be a good idea.
Add another missing variant Move path parameter before items per page Have a previous variant call the new variant with a null path
For some reason, I can't reply to your comment above about adding the 2 new APIs. I added the second one, but the first one was already there. Thanks for maintaining this project, and for your quick responses on my request! Sue |
Changes look good, and thanks again for your contribution. |
@swilson11 |
Simple variation to make it easy to find all commits for a given file.