Skip to content
Snippets Groups Projects
Commit ff35b37f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

transfer also wiki repository when transfer a project

parent 1fb99264
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -5,6 +5,8 @@
class ProjectTransferService
include Gitlab::ShellAdapter
 
class TransferError < StandardError; end
attr_accessor :project
 
def transfer(project, new_namespace)
Loading
Loading
@@ -19,14 +21,18 @@ class ProjectTransferService
project.namespace = new_namespace
project.save!
 
# Move main repository
unless gitlab_shell.mv_repository(old_path, new_path)
raise TransferError.new('Cannot move project')
end
 
# Move wiki repo also if present
if project.wikis.any?
gitlab_shell.mv_repository("#{old_path}.wiki", "#{new_path}.wiki")
end
true
end
rescue => ex
raise Project::TransferError.new(ex.message)
end
end
 
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment