diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-01-11 23:12:34 +0000 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-03-15 02:39:08 +0000 |
commit | 1baac9211238f60d2d2a50cccd0bea6979bfa6ba (patch) | |
tree | 7f07f3d1eb65f31f01c52973d115d349a95e3de2 /app/services/files/create_service.rb | |
parent | ffb1c65b0ba7fa8a4ea7e128cb47449f04837869 (diff) | |
download | gitlab-ce-1baac9211238f60d2d2a50cccd0bea6979bfa6ba.tar.gz |
Multi-file upload and Commit API obey LFS filters
Updates Files::MultiService for the commits API which is in turn used by the
multi-file upload web UI
Ensures that files which should be in LFS are transformed into LFS pointers
Uses Lfs::Transformer which then links LfsObjectProjects on success
Diffstat (limited to 'app/services/files/create_service.rb')
-rw-r--r-- | app/services/files/create_service.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/services/files/create_service.rb b/app/services/files/create_service.rb index 675b05e8fc4..b8ae03842a3 100644 --- a/app/services/files/create_service.rb +++ b/app/services/files/create_service.rb @@ -1,9 +1,8 @@ module Files class CreateService < Files::BaseService def create_commit! - handler = Lfs::FileTransformer.new(project, @branch_name) - - handler.new_file(@file_path, @file_content) do |content_or_lfs_pointer| + Lfs::FileTransformer.link_lfs_objects(project, @branch_name) do |transformer| + content_or_lfs_pointer = transformer.new_file(@file_path, @file_content) create_transformed_commit(content_or_lfs_pointer) end end |