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
f4a7ca8b
Commit
f4a7ca8b
authored
Jul 10, 2018
by
Jacob Vosmaer (GitLab)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'gitaly-with-config' into 'master'"
This reverts merge request !6428
parent
7abbde6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
34 deletions
+8
-34
ee/app/models/ee/repository.rb
ee/app/models/ee/repository.rb
+7
-2
ee/spec/models/repository_spec.rb
ee/spec/models/repository_spec.rb
+0
-27
ee/spec/services/geo/repository_sync_service_spec.rb
ee/spec/services/geo/repository_sync_service_spec.rb
+1
-5
No files found.
ee/app/models/ee/repository.rb
View file @
f4a7ca8b
...
@@ -11,12 +11,17 @@ module EE
...
@@ -11,12 +11,17 @@ module EE
end
end
# Transiently sets a configuration variable
# Transiently sets a configuration variable
# Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/1241
def
with_config
(
values
=
{})
def
with_config
(
values
=
{})
raw_repository
.
set_config
(
values
)
::
Gitlab
::
GitalyClient
::
StorageSettings
.
allow_disk_access
do
values
.
each
{
|
k
,
v
|
rugged
.
config
[
k
]
=
v
}
end
yield
yield
ensure
ensure
raw_repository
.
delete_config
(
*
values
.
keys
)
::
Gitlab
::
GitalyClient
::
StorageSettings
.
allow_disk_access
do
values
.
keys
.
each
{
|
key
|
rugged
.
config
.
delete
(
key
)
}
end
end
end
# Runs code after a repository has been synced.
# Runs code after a repository has been synced.
...
...
ee/spec/models/repository_spec.rb
View file @
f4a7ca8b
...
@@ -34,33 +34,6 @@ describe Repository do
...
@@ -34,33 +34,6 @@ describe Repository do
end
end
end
end
describe
'#with_config'
do
let
(
:rugged
)
do
Gitlab
::
GitalyClient
::
StorageSettings
.
allow_disk_access
do
repository
.
rugged
end
end
let
(
:entries
)
{
{
'test.foo1'
=>
'hello'
,
'test.foo2'
=>
'world'
}
}
it
'sets config only during the block'
do
keys_should_not_be_set
repository
.
with_config
(
entries
)
do
entries
.
each
do
|
key
,
value
|
expect
(
rugged
.
config
[
key
]).
to
eq
(
value
)
end
end
keys_should_not_be_set
end
def
keys_should_not_be_set
entries
.
each
do
|
key
,
value
|
expect
(
rugged
.
config
[
key
]).
to
be_blank
end
end
end
describe
"Elastic search"
,
:elastic
do
describe
"Elastic search"
,
:elastic
do
before
do
before
do
stub_ee_application_setting
(
elasticsearch_search:
true
,
elasticsearch_indexing:
true
)
stub_ee_application_setting
(
elasticsearch_search:
true
,
elasticsearch_indexing:
true
)
...
...
ee/spec/services/geo/repository_sync_service_spec.rb
View file @
f4a7ca8b
...
@@ -286,11 +286,7 @@ describe Geo::RepositorySyncService do
...
@@ -286,11 +286,7 @@ describe Geo::RepositorySyncService do
subject
.
execute
subject
.
execute
repo_path
=
Gitlab
::
GitalyClient
::
StorageSettings
.
allow_disk_access
do
expect
(
File
.
directory?
(
project
.
repository
.
path
)).
to
be
true
project
.
repository
.
path
end
expect
(
File
.
directory?
(
repo_path
)).
to
be
true
end
end
it
'tries to redownload repo when force_redownload flag is set'
do
it
'tries to redownload repo when force_redownload flag is set'
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