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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
2cdb73b3
Commit
2cdb73b3
authored
Sep 16, 2019
by
John Cai
Committed by
Zeger-Jan van de Weg
Sep 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add config options for partial clone
parent
3d999ccd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
changelogs/unreleased/jc-add-config-options-for-partial-clone.yml
...gs/unreleased/jc-add-config-options-for-partial-clone.yml
+5
-0
lib/api/internal/base.rb
lib/api/internal/base.rb
+4
-0
spec/requests/api/internal/base_spec.rb
spec/requests/api/internal/base_spec.rb
+19
-1
No files found.
changelogs/unreleased/jc-add-config-options-for-partial-clone.yml
0 → 100644
View file @
2cdb73b3
---
title
:
Add allowFilter and allowAnySHA1InWant for partial clones
merge_request
:
16850
author
:
type
:
added
lib/api/internal/base.rb
View file @
2cdb73b3
...
...
@@ -78,6 +78,10 @@ module API
receive_max_input_size
=
Gitlab
::
CurrentSettings
.
receive_max_input_size
.
to_i
if
receive_max_input_size
>
0
payload
[
:git_config_options
]
<<
"receive.maxInputSize=
#{
receive_max_input_size
.
megabytes
}
"
if
Feature
.
enabled?
(
:gitaly_upload_pack_filter
,
project
)
payload
[
:git_config_options
]
<<
"uploadpack.allowFilter=true"
<<
"uploadpack.allowAnySHA1InWant=true"
end
end
response_with_status
(
**
payload
)
...
...
spec/requests/api/internal/base_spec.rb
View file @
2cdb73b3
...
...
@@ -403,12 +403,30 @@ describe API::Internal::Base do
end
context
'when receive_max_input_size has been updated'
do
it
'returns custom git config'
do
before
do
allow
(
Gitlab
::
CurrentSettings
).
to
receive
(
:receive_max_input_size
)
{
1
}
end
it
'returns custom git config'
do
push
(
key
,
project
)
expect
(
json_response
[
"git_config_options"
]).
to
be_present
expect
(
json_response
[
"git_config_options"
]).
to
include
(
"uploadpack.allowFilter=true"
)
expect
(
json_response
[
"git_config_options"
]).
to
include
(
"uploadpack.allowAnySHA1InWant=true"
)
end
context
'when gitaly_upload_pack_filter feature flag is disabled'
do
before
do
stub_feature_flags
(
gitaly_upload_pack_filter:
{
enabled:
false
,
thing:
project
})
end
it
'does not include allowFilter and allowAnySha1InWant in the git config options'
do
push
(
key
,
project
)
expect
(
json_response
[
"git_config_options"
]).
to
be_present
expect
(
json_response
[
"git_config_options"
]).
not_to
include
(
"uploadpack.allowFilter=true"
)
expect
(
json_response
[
"git_config_options"
]).
not_to
include
(
"uploadpack.allowAnySHA1InWant=true"
)
end
end
end
...
...
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