diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2017-08-03 10:22:01 +0200 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2017-08-07 18:57:06 +0200 |
commit | c0b41064ff1eb4c5465d3c2a9efa0a22b60c3f4c (patch) | |
tree | ab1536b60e649a4ffa116d54da7eeac0d8fdf254 /lib | |
parent | b12107a0b953b566cd58db30ae880800a4a695a6 (diff) | |
download | gitlab-ce-c0b41064ff1eb4c5465d3c2a9efa0a22b60c3f4c.tar.gz |
Migrate Repository#find_commits_by_message to Gitalyfeature/migrate-find-commits-by-message-to-gitaly
Closes gitaly#443
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/gitaly_client/commit_service.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/gitaly_client/commit_service.rb b/lib/gitlab/gitaly_client/commit_service.rb index ac6817e6d0e..3f577ac8530 100644 --- a/lib/gitlab/gitaly_client/commit_service.rb +++ b/lib/gitlab/gitaly_client/commit_service.rb @@ -135,6 +135,20 @@ module Gitlab consume_commits_response(response) end + def commits_by_message(query, revision: '', path: '', limit: 1000, offset: 0) + request = Gitaly::CommitsByMessageRequest.new( + repository: @gitaly_repo, + query: query, + revision: revision.to_s.force_encoding(Encoding::ASCII_8BIT), + path: path.to_s.force_encoding(Encoding::ASCII_8BIT), + limit: limit.to_i, + offset: offset.to_i + ) + + response = GitalyClient.call(@repository.storage, :commit_service, :commits_by_message, request) + consume_commits_response(response) + end + def languages(ref = nil) request = Gitaly::CommitLanguagesRequest.new(repository: @gitaly_repo, revision: ref || '') response = GitalyClient.call(@repository.storage, :commit_service, :commit_languages, request) |