diff options
author | Stan Hu <stanhu@gmail.com> | 2017-11-17 20:19:12 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-11-17 20:19:12 +0000 |
commit | 121508f81fec8773af37a345abb6c33b7a3c4518 (patch) | |
tree | 600c2641f888cd0987e634ca46dd71f3ff74a0bf | |
parent | d63b39c37d7908e3283976187e4d390e1bc9c79d (diff) | |
parent | 9b3b0f02a6ffc16e61f237f2757ff2990610225e (diff) | |
download | gitlab-ce-121508f81fec8773af37a345abb6c33b7a3c4518.tar.gz |
Merge branch '4056-hashed-storage-upload-transfers' into 'master'
Fix project transfer with hashed-storage attachments
Closes gitlab-ee#4056
See merge request gitlab-org/gitlab-ce!15457
-rw-r--r-- | app/services/projects/transfer_service.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/services/projects/transfer_service.rb b/app/services/projects/transfer_service.rb index d3a8ae8d7c6..e5cd6fcdfe3 100644 --- a/app/services/projects/transfer_service.rb +++ b/app/services/projects/transfer_service.rb @@ -67,7 +67,7 @@ module Projects Labels::TransferService.new(current_user, @old_group, project).execute # Move uploads - Gitlab::UploadsTransfer.new.move_project(project.path, @old_namespace.full_path, @new_namespace.full_path) + move_project_uploads(project) # Move pages Gitlab::PagesTransfer.new.move_project(project.path, @old_namespace.full_path, @new_namespace.full_path) @@ -139,5 +139,15 @@ module Projects # Move wiki repo also if present move_repo_folder("#{@old_path}.wiki", "#{@new_path}.wiki") end + + def move_project_uploads(project) + return if project.hashed_storage?(:attachments) + + Gitlab::UploadsTransfer.new.move_project( + project.path, + @old_namespace.full_path, + @new_namespace.full_path + ) + end end end |