Commit e61f66b3 authored by Stan Hu's avatar Stan Hu

When moving issues, don't attempt to move files in object storage

Closes #48505
parent cd578941
---
title: When moving issues, don't attempt to move files in object storage
merge_request:
author:
type: fixed
...@@ -48,7 +48,7 @@ module Gitlab ...@@ -48,7 +48,7 @@ module Gitlab
def find_file(project, secret, file) def find_file(project, secret, file)
uploader = FileUploader.new(project, secret: secret) uploader = FileUploader.new(project, secret: secret)
uploader.retrieve_from_store!(file) uploader.retrieve_from_store!(file)
uploader.file uploader.file if uploader.object_store == ObjectStorage::Store::LOCAL
end end
# Because the uploaders use 'move_to_store' we must have a temporary # Because the uploaders use 'move_to_store' we must have a temporary
......
...@@ -62,5 +62,24 @@ describe Gitlab::Gfm::UploadsRewriter do ...@@ -62,5 +62,24 @@ describe Gitlab::Gfm::UploadsRewriter do
subject { rewriter.files } subject { rewriter.files }
it { is_expected.to be_an(Array) } it { is_expected.to be_an(Array) }
end end
describe 'with object storage' do
before do
stub_uploads_object_storage(uploader: FileUploader)
zip_uploader.migrate!(FileUploader::Store::REMOTE)
end
describe '#needs_rewrite?' do
subject { rewriter.needs_rewrite? }
it { is_expected.to eq false }
end
describe '#files' do
subject { rewriter.files }
it { is_expected.to eq([]) }
end
end
end end
end end
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