summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-04-03 14:40:17 +0000
committerRobert Speicher <robert@gitlab.com>2017-04-03 14:40:17 +0000
commitb23b76d8eb182ccc57beee37340ff3c5b726dd9b (patch)
tree39da7f8ec83afe9e1f5e7a3ccb89847d19850961 /lib
parent41396031162ab62cfac2837acdfcc200e74fda73 (diff)
parent13487809c7fd9994f14babf3e189b434f61692ca (diff)
downloadgitlab-ce-b23b76d8eb182ccc57beee37340ff3c5b726dd9b.tar.gz
Merge branch 'workhorse-gitaly-repository' into 'master'
Pass Gitaly 'Repository' messages to workhorse for Git HTTP Closes gitaly#148 See merge request !10343
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/workhorse.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/workhorse.rb b/lib/gitlab/workhorse.rb
index 6fe85af3c30..d1131ad65e0 100644
--- a/lib/gitlab/workhorse.rb
+++ b/lib/gitlab/workhorse.rb
@@ -17,14 +17,22 @@ module Gitlab
class << self
def git_http_ok(repository, user)
+ repo_path = repository.path_to_repo
params = {
GL_ID: Gitlab::GlId.gl_id(user),
- RepoPath: repository.path_to_repo,
+ RepoPath: repo_path,
}
if Gitlab.config.gitaly.enabled
- address = Gitlab::GitalyClient.get_address(repository.project.repository_storage)
+ storage = repository.project.repository_storage
+ address = Gitlab::GitalyClient.get_address(storage)
params[:GitalySocketPath] = URI(address).path
+ # TODO: use GitalyClient code to assemble the Repository message
+ params[:Repository] = Gitaly::Repository.new(
+ path: repo_path,
+ storage_name: storage,
+ relative_path: Gitlab::RepoPath.strip_storage_path(repo_path),
+ ).to_h
end
params