Update wiki repository path suffix

parent 2df26509
...@@ -8,13 +8,12 @@ module Projects ...@@ -8,13 +8,12 @@ module Projects
class BaseRepositoryService < BaseService class BaseRepositoryService < BaseService
include Gitlab::ShellAdapter include Gitlab::ShellAdapter
attr_reader :old_disk_path, :new_disk_path, :old_wiki_disk_path, :old_storage_version, :logger, :move_wiki attr_reader :old_disk_path, :new_disk_path, :old_storage_version, :logger, :move_wiki
def initialize(project:, old_disk_path:, logger: nil) def initialize(project:, old_disk_path:, logger: nil)
@project = project @project = project
@logger = logger || Gitlab::AppLogger @logger = logger || Gitlab::AppLogger
@old_disk_path = old_disk_path @old_disk_path = old_disk_path
@old_wiki_disk_path = "#{old_disk_path}.wiki"
@move_wiki = has_wiki? @move_wiki = has_wiki?
end end
...@@ -48,7 +47,7 @@ module Projects ...@@ -48,7 +47,7 @@ module Projects
result = move_repository(old_disk_path, new_disk_path) result = move_repository(old_disk_path, new_disk_path)
if move_wiki if move_wiki
result &&= move_repository(old_wiki_disk_path, "#{new_disk_path}.wiki") result &&= move_repository(old_wiki_disk_path, new_wiki_disk_path)
end end
result result
...@@ -56,7 +55,7 @@ module Projects ...@@ -56,7 +55,7 @@ module Projects
def rollback_folder_move def rollback_folder_move
move_repository(new_disk_path, old_disk_path) move_repository(new_disk_path, old_disk_path)
move_repository("#{new_disk_path}.wiki", old_wiki_disk_path) move_repository(new_wiki_disk_path, old_wiki_disk_path)
end end
def try_to_set_repository_read_only! def try_to_set_repository_read_only!
...@@ -68,6 +67,18 @@ module Projects ...@@ -68,6 +67,18 @@ module Projects
raise RepositoryInUseError, migration_error raise RepositoryInUseError, migration_error
end end
end end
def wiki_path_suffix
@wiki_path_suffix ||= Gitlab::GlRepository::WIKI.path_suffix
end
def old_wiki_disk_path
@old_wiki_disk_path ||= "#{old_disk_path}#{wiki_path_suffix}"
end
def new_wiki_disk_path
@new_wiki_disk_path ||= "#{new_disk_path}#{wiki_path_suffix}"
end
end end
end end
end end
......
...@@ -69,7 +69,7 @@ module Geo ...@@ -69,7 +69,7 @@ module Geo
end end
def wiki_path_suffix def wiki_path_suffix
Gitlab::GlRepository::WIKI.path_suffix Gitlab::GlRepository::WIKI.path_suffix
end end
def old_wiki_disk_path def old_wiki_disk_path
......
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