Commit 91226c20 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Move workhorse protocol code into lib

parent 6cc6d973
......@@ -115,12 +115,12 @@ class Projects::GitHttpController < Projects::ApplicationController
end
end
def repo_path
@repo_path ||= begin
def repository
@repository ||= begin
if params[:project_id].end_with?('.wiki.git')
project.wiki.wiki.path
project.wiki.repository
else
repository.path_to_repo
project.repository
end
end
end
......@@ -142,10 +142,7 @@ class Projects::GitHttpController < Projects::ApplicationController
end
def render_ok
render json: {
'GL_ID' => Gitlab::ShellEnv.gl_id(@user),
'RepoPath' => repo_path,
}
render json: Gitlab::Workhorse.git_http_ok(repository, user)
end
def render_not_found
......
......@@ -6,6 +6,13 @@ module Gitlab
SEND_DATA_HEADER = 'Gitlab-Workhorse-Send-Data'
class << self
def git_http_ok(repository, user)
{
'GL_ID' => Gitlab::ShellEnv.gl_id(user),
'RepoPath' => repository.path_to_repo,
}
end
def send_git_blob(repository, blob)
params = {
'RepoPath' => repository.path_to_repo,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment