Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
91226c20
Commit
91226c20
authored
Apr 06, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move workhorse protocol code into lib
parent
6cc6d973
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
app/controllers/projects/git_http_controller.rb
app/controllers/projects/git_http_controller.rb
+5
-8
lib/gitlab/workhorse.rb
lib/gitlab/workhorse.rb
+7
-0
No files found.
app/controllers/projects/git_http_controller.rb
View file @
91226c20
...
@@ -115,12 +115,12 @@ class Projects::GitHttpController < Projects::ApplicationController
...
@@ -115,12 +115,12 @@ class Projects::GitHttpController < Projects::ApplicationController
end
end
end
end
def
repo
_path
def
repo
sitory
@repo
_path
||=
begin
@repo
sitory
||=
begin
if
params
[
:project_id
].
end_with?
(
'.wiki.git'
)
if
params
[
:project_id
].
end_with?
(
'.wiki.git'
)
project
.
wiki
.
wiki
.
path
project
.
wiki
.
repository
else
else
repository
.
path_to_repo
project
.
repository
end
end
end
end
end
end
...
@@ -142,10 +142,7 @@ class Projects::GitHttpController < Projects::ApplicationController
...
@@ -142,10 +142,7 @@ class Projects::GitHttpController < Projects::ApplicationController
end
end
def
render_ok
def
render_ok
render
json:
{
render
json:
Gitlab
::
Workhorse
.
git_http_ok
(
repository
,
user
)
'GL_ID'
=>
Gitlab
::
ShellEnv
.
gl_id
(
@user
),
'RepoPath'
=>
repo_path
,
}
end
end
def
render_not_found
def
render_not_found
...
...
lib/gitlab/workhorse.rb
View file @
91226c20
...
@@ -6,6 +6,13 @@ module Gitlab
...
@@ -6,6 +6,13 @@ module Gitlab
SEND_DATA_HEADER
=
'Gitlab-Workhorse-Send-Data'
SEND_DATA_HEADER
=
'Gitlab-Workhorse-Send-Data'
class
<<
self
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
)
def
send_git_blob
(
repository
,
blob
)
params
=
{
params
=
{
'RepoPath'
=>
repository
.
path_to_repo
,
'RepoPath'
=>
repository
.
path_to_repo
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment