Commit 3cbec51b authored by Nick Thomas's avatar Nick Thomas

Use wiki.disk_path in EE

parent 7c63e8dc
...@@ -10,7 +10,7 @@ module Geo ...@@ -10,7 +10,7 @@ module Geo
repository_storage_name: project.repository.storage, repository_storage_name: project.repository.storage,
repository_storage_path: project.repository_storage_path, repository_storage_path: project.repository_storage_path,
repo_path: project.disk_path, repo_path: project.disk_path,
wiki_path: ("#{project.disk_path}.wiki" if project.wiki_enabled?), wiki_path: (project.wiki.disk_path if project.wiki_enabled?),
project_name: project.name project_name: project.name
) )
end end
......
...@@ -31,7 +31,7 @@ module Geo ...@@ -31,7 +31,7 @@ module Geo
end end
def new_wiki_path_with_namespace def new_wiki_path_with_namespace
"#{project.disk_path}.wiki" project.wiki.disk_path
end end
end end
end end
...@@ -11,7 +11,7 @@ module Projects ...@@ -11,7 +11,7 @@ module Projects
result = move_storage(project.disk_path, new_storage_path) result = move_storage(project.disk_path, new_storage_path)
if project.wiki.repository_exists? if project.wiki.repository_exists?
result &&= move_storage("#{project.disk_path}.wiki", new_storage_path) result &&= move_storage(project.wiki.disk_path, new_storage_path)
end end
if result if result
...@@ -44,7 +44,7 @@ module Projects ...@@ -44,7 +44,7 @@ module Projects
if wiki.repository_exists? if wiki.repository_exists?
GitlabShellWorker.perform_async(:mv_repository, GitlabShellWorker.perform_async(:mv_repository,
old_repository_storage_path, old_repository_storage_path,
"#{disk_path}.wiki", wiki.disk_path,
"#{new_project_path}.wiki") "#{new_project_path}.wiki")
end end
end end
......
...@@ -6,7 +6,7 @@ describe Projects::DestroyService do ...@@ -6,7 +6,7 @@ describe Projects::DestroyService do
let!(:project_id) { project.id } let!(:project_id) { project.id }
let!(:project_name) { project.name } let!(:project_name) { project.name }
let!(:project_path) { project.disk_path } let!(:project_path) { project.disk_path }
let!(:wiki_path) { project.disk_path + '.wiki' } let!(:wiki_path) { project.wiki.disk_path }
let!(:storage_name) { project.repository_storage } let!(:storage_name) { project.repository_storage }
let!(:storage_path) { project.repository_storage_path } let!(:storage_path) { project.repository_storage_path }
......
...@@ -24,7 +24,7 @@ FactoryGirl.define do ...@@ -24,7 +24,7 @@ FactoryGirl.define do
repository_storage_path { project.repository_storage_path } repository_storage_path { project.repository_storage_path }
add_attribute(:repo_path) { project.disk_path } add_attribute(:repo_path) { project.disk_path }
project_name { project.name } project_name { project.name }
wiki_path { "#{project.disk_path}.wiki" } wiki_path { project.wiki.disk_path }
end end
factory :geo_repository_updated_event, class: Geo::RepositoryUpdatedEvent do factory :geo_repository_updated_event, class: Geo::RepositoryUpdatedEvent do
......
...@@ -29,7 +29,7 @@ describe Geo::RepositoryCreatedEventStore do ...@@ -29,7 +29,7 @@ describe Geo::RepositoryCreatedEventStore do
expect(event).to have_attributes( expect(event).to have_attributes(
project_id: project.id, project_id: project.id,
repo_path: project.disk_path, repo_path: project.disk_path,
wiki_path: "#{project.disk_path}.wiki", wiki_path: project.wiki.disk_path,
project_name: project.name, project_name: project.name,
repository_storage_name: project.repository_storage, repository_storage_name: project.repository_storage,
repository_storage_path: project.repository_storage_path repository_storage_path: project.repository_storage_path
......
...@@ -33,7 +33,7 @@ describe Geo::RepositoryRenamedEventStore do ...@@ -33,7 +33,7 @@ describe Geo::RepositoryRenamedEventStore do
expect(event.old_path_with_namespace).to eq(old_path_with_namespace) expect(event.old_path_with_namespace).to eq(old_path_with_namespace)
expect(event.new_path_with_namespace).to eq(project.disk_path) expect(event.new_path_with_namespace).to eq(project.disk_path)
expect(event.old_wiki_path_with_namespace).to eq("#{old_path_with_namespace}.wiki") expect(event.old_wiki_path_with_namespace).to eq("#{old_path_with_namespace}.wiki")
expect(event.new_wiki_path_with_namespace).to eq("#{project.disk_path}.wiki") expect(event.new_wiki_path_with_namespace).to eq(project.wiki.disk_path)
expect(event.old_path).to eq(old_path) expect(event.old_path).to eq(old_path)
expect(event.new_path).to eq(project.path) expect(event.new_path).to eq(project.path)
end end
......
...@@ -83,12 +83,12 @@ describe Projects::UpdateRepositoryStorageService do ...@@ -83,12 +83,12 @@ describe Projects::UpdateRepositoryStorageService do
"#{project.disk_path}+#{project.id}+moved+#{time.to_i}") "#{project.disk_path}+#{project.id}+moved+#{time.to_i}")
expect(gitlab_shell).to receive(:mv_storage) expect(gitlab_shell).to receive(:mv_storage)
.with('tmp/tests/storage_a', "#{project.disk_path}.wiki", 'tmp/tests/storage_b') .with('tmp/tests/storage_a', project.wiki.disk_path, 'tmp/tests/storage_b')
.and_return(true) .and_return(true)
expect(GitlabShellWorker).to receive(:perform_async) expect(GitlabShellWorker).to receive(:perform_async)
.with(:mv_repository, .with(:mv_repository,
'tmp/tests/storage_a', 'tmp/tests/storage_a',
"#{project.disk_path}.wiki", project.wiki.disk_path,
"#{project.disk_path}+#{project.id}+moved+#{time.to_i}.wiki") "#{project.disk_path}+#{project.id}+moved+#{time.to_i}.wiki")
subject.execute('b') subject.execute('b')
...@@ -104,7 +104,7 @@ describe Projects::UpdateRepositoryStorageService do ...@@ -104,7 +104,7 @@ describe Projects::UpdateRepositoryStorageService do
.with('tmp/tests/storage_a', project.disk_path, 'tmp/tests/storage_b') .with('tmp/tests/storage_a', project.disk_path, 'tmp/tests/storage_b')
.and_return(true) .and_return(true)
expect(gitlab_shell).to receive(:mv_storage) expect(gitlab_shell).to receive(:mv_storage)
.with('tmp/tests/storage_a', "#{project.disk_path}.wiki", 'tmp/tests/storage_b') .with('tmp/tests/storage_a', project.wiki.disk_path, 'tmp/tests/storage_b')
.and_return(false) .and_return(false)
expect(GitlabShellWorker).not_to receive(:perform_async) expect(GitlabShellWorker).not_to receive(:perform_async)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment