Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-07-17 13:17:43 +0300
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-07-18 15:46:27 +0300
commit9348efc6bae3f5eee948fc6871fa4bf5afbbfd4e (patch)
tree53ecaa1ad4beaa9c823ca9781097c6fbecf4fb4a /lib/gitlab/gitaly_client
parent740ae2d194f3833e224c326cc909d833c5807484 (diff)
Client implementation for Repository#new_commits
After trying to remove the whole method in 8f69014af2902d8d53fe931268bec60f6858f160, this is a more gentle approach to the method. :) Prior to this change, new commit detection wasn't implemented in Gitaly, this was done through: https://gitlab.com/gitlab-org/gitaly/merge_requests/779 As the new implemented got moved around a bit, the whole RevList class got removed. Part of https://gitlab.com/gitlab-org/gitaly/issues/1233
Diffstat (limited to 'lib/gitlab/gitaly_client')
-rw-r--r--lib/gitlab/gitaly_client/ref_service.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/gitlab/gitaly_client/ref_service.rb b/lib/gitlab/gitaly_client/ref_service.rb
index 7f4eed9222a..1ad6376dac7 100644
--- a/lib/gitlab/gitaly_client/ref_service.rb
+++ b/lib/gitlab/gitaly_client/ref_service.rb
@@ -56,6 +56,25 @@ module Gitlab
encode!(response.name.dup)
end
+ def list_new_commits(newrev)
+ request = Gitaly::ListNewCommitsRequest.new(
+ repository: @gitaly_repo,
+ commit_id: newrev
+ )
+
+ response = GitalyClient
+ .call(@storage, :ref_service, :list_new_commits, request, timeout: GitalyClient.medium_timeout)
+
+ commits = []
+ response.each do |msg|
+ msg.commits.each do |c|
+ commits << Gitlab::Git::Commit.new(@repository, c)
+ end
+ end
+
+ commits
+ end
+
def count_tag_names
tag_names.count
end