Class: Gitlab::UploadsTransfer

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/uploads_transfer.rb

Instance Method Summary collapse

Instance Method Details

#move_project(project_path, namespace_path_was, namespace_path) ⇒ Object


3
4
5
6
7
8
9
# File 'lib/gitlab/uploads_transfer.rb', line 3

def move_project(project_path, namespace_path_was, namespace_path)
  new_namespace_folder = File.join(root_dir, namespace_path)
  FileUtils.mkdir_p(new_namespace_folder) unless Dir.exist?(new_namespace_folder)
  from = File.join(root_dir, namespace_path_was, project_path)
  to = File.join(root_dir, namespace_path, project_path)
  move(from, to, "")
end

#rename_namespace(path_was, path) ⇒ Object


16
17
18
# File 'lib/gitlab/uploads_transfer.rb', line 16

def rename_namespace(path_was, path)
  move(path_was, path)
end

#rename_project(path_was, path, namespace_path) ⇒ Object


11
12
13
14
# File 'lib/gitlab/uploads_transfer.rb', line 11

def rename_project(path_was, path, namespace_path)
  base_dir = File.join(root_dir, namespace_path)
  move(path_was, path, base_dir)
end