summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJ Mountney <david@twkie.net>2017-06-08 11:29:36 -0700
committerDJ Mountney <david@twkie.net>2017-06-08 11:29:36 -0700
commite0e5d097327c52e54a6e7433bbf0e350f15bf1f3 (patch)
tree6da8e9ff0f5989d9566794292af5cb4eb58d679f
parent2afd2fbcb83baaeee8c66859c08b4acff812dccf (diff)
parent70d7ded5b38376809365cadd7e542254003f8210 (diff)
downloadgitlab-ce-master-security-update.tar.gz
Merge remote-tracking branch 'origin/upstream-9-2-security' into master-security-updatemaster-security-update
-rw-r--r--app/uploaders/gitlab_uploader.rb4
-rw-r--r--spec/migrations/rename_system_namespaces_spec.rb12
2 files changed, 10 insertions, 6 deletions
diff --git a/app/uploaders/gitlab_uploader.rb b/app/uploaders/gitlab_uploader.rb
index 489613030e6..e4e6d6f46b1 100644
--- a/app/uploaders/gitlab_uploader.rb
+++ b/app/uploaders/gitlab_uploader.rb
@@ -15,10 +15,12 @@ class GitlabUploader < CarrierWave::Uploader::Base
# This method is overridden in the `FileUploader`
def self.base_dir
return root_dir unless file_storage?
+
+ File.join(root_dir, 'system')
end
def self.file_storage?
- self.storage.is_a?(CarrierWave::Storage::File)
+ self.storage == CarrierWave::Storage::File
end
delegate :base_dir, :file_storage?, to: :class
diff --git a/spec/migrations/rename_system_namespaces_spec.rb b/spec/migrations/rename_system_namespaces_spec.rb
index ad1b83d8e2e..626a6005838 100644
--- a/spec/migrations/rename_system_namespaces_spec.rb
+++ b/spec/migrations/rename_system_namespaces_spec.rb
@@ -79,7 +79,9 @@ describe RenameSystemNamespaces, truncate: true do
it "moves the the repository for a project in the namespace" do
project = build(:project, namespace: system_namespace, path: "system-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")
migration.up
@@ -230,10 +232,10 @@ describe RenameSystemNamespaces, truncate: true do
describe "#child_ids_for_parent" do
it "collects child ids for all levels" do
- parent = create(:namespace)
- first_child = create(:namespace, parent: parent)
- second_child = create(:namespace, parent: parent)
- third_child = create(:namespace, parent: second_child)
+ parent = create(:group)
+ first_child = create(:group, parent: parent)
+ second_child = create(:group, parent: parent)
+ third_child = create(:group, parent: second_child)
all_ids = [parent.id, first_child.id, second_child.id, third_child.id]
collected_ids = migration.child_ids_for_parent(parent, ids: [parent.id])