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
527f87df
Commit
527f87df
authored
Oct 12, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support show-all-refs for git over HTTP
parent
2d5c4532
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
5 deletions
+25
-5
GITLAB_WORKHORSE_VERSION
GITLAB_WORKHORSE_VERSION
+1
-1
changelogs/unreleased/backport-workhorse-show-all-refs.yml
changelogs/unreleased/backport-workhorse-show-all-refs.yml
+5
-0
lib/gitlab/workhorse.rb
lib/gitlab/workhorse.rb
+3
-2
spec/lib/gitlab/workhorse_spec.rb
spec/lib/gitlab/workhorse_spec.rb
+16
-2
No files found.
GITLAB_WORKHORSE_VERSION
View file @
527f87df
3.
2
.0
3.
3
.0
changelogs/unreleased/backport-workhorse-show-all-refs.yml
0 → 100644
View file @
527f87df
---
title
:
Support show-all-refs for git over HTTP
merge_request
:
14834
author
:
type
:
added
lib/gitlab/workhorse.rb
View file @
527f87df
...
...
@@ -16,14 +16,15 @@ module Gitlab
SECRET_LENGTH
=
32
class
<<
self
def
git_http_ok
(
repository
,
is_wiki
,
user
,
action
)
def
git_http_ok
(
repository
,
is_wiki
,
user
,
action
,
show_all_refs:
false
)
project
=
repository
.
project
repo_path
=
repository
.
path_to_repo
params
=
{
GL_ID
:
Gitlab
::
GlId
.
gl_id
(
user
),
GL_REPOSITORY
:
Gitlab
::
GlRepository
.
gl_repository
(
project
,
is_wiki
),
GL_USERNAME
:
user
&
.
username
,
RepoPath
:
repo_path
RepoPath
:
repo_path
,
ShowAllRefs
:
show_all_refs
}
server
=
{
address:
Gitlab
::
GitalyClient
.
address
(
project
.
repository_storage
),
...
...
spec/lib/gitlab/workhorse_spec.rb
View file @
527f87df
...
...
@@ -268,7 +268,8 @@ describe Gitlab::Workhorse do
GL_ID
:
"user-
#{
user
.
id
}
"
,
GL_USERNAME
:
user
.
username
,
GL_REPOSITORY
:
"project-
#{
project
.
id
}
"
,
RepoPath
:
repo_path
RepoPath
:
repo_path
,
ShowAllRefs
:
false
}
end
...
...
@@ -282,7 +283,8 @@ describe Gitlab::Workhorse do
GL_ID
:
"user-
#{
user
.
id
}
"
,
GL_USERNAME
:
user
.
username
,
GL_REPOSITORY
:
"wiki-
#{
project
.
id
}
"
,
RepoPath
:
repo_path
RepoPath
:
repo_path
,
ShowAllRefs
:
false
}
end
...
...
@@ -324,6 +326,12 @@ describe Gitlab::Workhorse do
expect
(
subject
).
to
include
(
gitaly_params
)
end
context
'show_all_refs enabled'
do
subject
{
described_class
.
git_http_ok
(
repository
,
false
,
user
,
action
,
show_all_refs:
true
)
}
it
{
is_expected
.
to
include
(
ShowAllRefs
:
true
)
}
end
end
context
"when git_receive_pack action is passed"
do
...
...
@@ -336,6 +344,12 @@ describe Gitlab::Workhorse do
let
(
:action
)
{
'info_refs'
}
it
{
expect
(
subject
).
to
include
(
gitaly_params
)
}
context
'show_all_refs enabled'
do
subject
{
described_class
.
git_http_ok
(
repository
,
false
,
user
,
action
,
show_all_refs:
true
)
}
it
{
is_expected
.
to
include
(
ShowAllRefs
:
true
)
}
end
end
context
'when action passed is not supported by Gitaly'
do
...
...
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