Update wiki repository path suffix

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