diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-10-01 13:29:47 +0100 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-10-01 13:29:47 +0100 |
commit | a583f137ddc9833796752b9cf8c07077d76078ba (patch) | |
tree | cc92c76a4d29f61a24740e5ab45cd71926677d9c /lib/gitlab/git | |
parent | e8e1a51adddd9d7a504c06ea383cf682493f6a90 (diff) | |
download | gitlab-ce-a583f137ddc9833796752b9cf8c07077d76078ba.tar.gz |
Removes N+1 gitaly rpc call to fetch the last commit for path
Implements list_last_commits_for_tree to communicate with the
ListLastCommitsForTree Gitaly RPC
Bumps the Gitaly server version
Bumps the Gitaly-Proto gem version
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r-- | lib/gitlab/git/repository.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 3d5a63bdbac..45d42c7078f 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -953,6 +953,12 @@ module Gitlab end end + def list_last_commits_for_tree(sha, path, offset: 0, limit: 25) + wrapped_gitaly_errors do + gitaly_commit_client.list_last_commits_for_tree(sha, path, offset: offset, limit: limit) + end + end + def last_commit_for_path(sha, path) wrapped_gitaly_errors do gitaly_commit_client.last_commit_for_path(sha, path) |