Commit 91c9c4b7 authored by Micaël Bergeron's avatar Micaël Bergeron Committed by Stan Hu

fix an issue with local files

parent cebdd267
...@@ -162,12 +162,14 @@ class FileUploader < GitlabUploader ...@@ -162,12 +162,14 @@ class FileUploader < GitlabUploader
end end
def copy_file(file) def copy_file(file)
if file_storage? to_path = if file_storage?
store!(file) File.join(self.class.root, store_path)
else else
self.file = file.copy_to(store_path) store_path
record_upload # after_store is not triggered end
end
self.file = file.copy_to(to_path)
record_upload # after_store is not triggered
end end
private private
......
...@@ -80,24 +80,5 @@ describe Gitlab::Gfm::UploadsRewriter do ...@@ -80,24 +80,5 @@ 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