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
e0e5d097
Commit
e0e5d097
authored
Jun 08, 2017
by
DJ Mountney
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/upstream-9-2-security' into master-security-update
parents
2afd2fbc
70d7ded5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
app/uploaders/gitlab_uploader.rb
app/uploaders/gitlab_uploader.rb
+3
-1
spec/migrations/rename_system_namespaces_spec.rb
spec/migrations/rename_system_namespaces_spec.rb
+7
-5
No files found.
app/uploaders/gitlab_uploader.rb
View file @
e0e5d097
...
@@ -15,10 +15,12 @@ class GitlabUploader < CarrierWave::Uploader::Base
...
@@ -15,10 +15,12 @@ class GitlabUploader < CarrierWave::Uploader::Base
# This method is overridden in the `FileUploader`
# This method is overridden in the `FileUploader`
def
self
.
base_dir
def
self
.
base_dir
return
root_dir
unless
file_storage?
return
root_dir
unless
file_storage?
File
.
join
(
root_dir
,
'system'
)
end
end
def
self
.
file_storage?
def
self
.
file_storage?
self
.
storage
.
is_a?
(
CarrierWave
::
Storage
::
File
)
self
.
storage
==
CarrierWave
::
Storage
::
File
end
end
delegate
:base_dir
,
:file_storage?
,
to: :class
delegate
:base_dir
,
:file_storage?
,
to: :class
...
...
spec/migrations/rename_system_namespaces_spec.rb
View file @
e0e5d097
...
@@ -79,7 +79,9 @@ describe RenameSystemNamespaces, truncate: true do
...
@@ -79,7 +79,9 @@ describe RenameSystemNamespaces, truncate: true do
it
"moves the the repository for a project in the namespace"
do
it
"moves the the repository for a project in the namespace"
do
project
=
build
(
:project
,
namespace:
system_namespace
,
path:
"system-project"
)
project
=
build
(
:project
,
namespace:
system_namespace
,
path:
"system-project"
)
save_invalid_routable
(
project
)
save_invalid_routable
(
project
)
TestEnv
.
copy_repo
(
project
)
TestEnv
.
copy_repo
(
project
,
bare_repo:
TestEnv
.
factory_repo_path_bare
,
refs:
TestEnv
::
BRANCH_SHA
)
expected_repo
=
File
.
join
(
TestEnv
.
repos_path
,
"system0"
,
"system-project.git"
)
expected_repo
=
File
.
join
(
TestEnv
.
repos_path
,
"system0"
,
"system-project.git"
)
migration
.
up
migration
.
up
...
@@ -230,10 +232,10 @@ describe RenameSystemNamespaces, truncate: true do
...
@@ -230,10 +232,10 @@ describe RenameSystemNamespaces, truncate: true do
describe
"#child_ids_for_parent"
do
describe
"#child_ids_for_parent"
do
it
"collects child ids for all levels"
do
it
"collects child ids for all levels"
do
parent
=
create
(
:
namespace
)
parent
=
create
(
:
group
)
first_child
=
create
(
:
namespace
,
parent:
parent
)
first_child
=
create
(
:
group
,
parent:
parent
)
second_child
=
create
(
:
namespace
,
parent:
parent
)
second_child
=
create
(
:
group
,
parent:
parent
)
third_child
=
create
(
:
namespace
,
parent:
second_child
)
third_child
=
create
(
:
group
,
parent:
second_child
)
all_ids
=
[
parent
.
id
,
first_child
.
id
,
second_child
.
id
,
third_child
.
id
]
all_ids
=
[
parent
.
id
,
first_child
.
id
,
second_child
.
id
,
third_child
.
id
]
collected_ids
=
migration
.
child_ids_for_parent
(
parent
,
ids:
[
parent
.
id
])
collected_ids
=
migration
.
child_ids_for_parent
(
parent
,
ids:
[
parent
.
id
])
...
...
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