Skip to content

Commit

Permalink
Add the functionality for commit search.
Browse files Browse the repository at this point in the history
Ensure that the preview accept header is set properly
  • Loading branch information
azizshamim committed Nov 2, 2017
1 parent dd7a2a1 commit 25a9433
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/octokit/client/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ def search_code(query, options = {})
search "search/code", query, options
end

# Search commits
#
# @param query [String] Search terms and qualifiers
# @param options [Hash] Sort and pagination options
# @option options [String] :sort Sort field
# @option options [String] :order Sort order (asc or desc)
# @option options [Integer] :page Page of paginated results
# @option options [Integer] :per_page Number of items per page
# @return [Sawyer::Resource] Search results object
# @see https://developer.github.com/v3/search/#search-commits
def search_commits(query, options = {})
options = ensure_api_media_type(:commit_search, options)
search "search/commits", query, options
end

# Search issues
#
# @param query [String] Search term and qualifiers
Expand Down

0 comments on commit 25a9433

Please sign in to comment.