Add git filter flag only if it is supported

This commit is contained in:
Francisco Javier López 2018-06-07 15:49:01 +00:00 committed by Douwe Maan
parent e114c6fccc
commit ea2bd9cb4f

View file

@ -39,7 +39,11 @@ module Gitlab
end
def git_all_pointers
params = { options: ["--filter=blob:limit=#{Gitlab::Git::Blob::LFS_POINTER_MAX_SIZE}"], require_path: true }
params = { require_path: true }
if Gitlab::Git.version >= Gitlab::VersionInfo.parse('2.16.0')
params[:options] = ["--filter=blob:limit=#{Gitlab::Git::Blob::LFS_POINTER_MAX_SIZE}"]
end
rev_list.all_objects(params) do |object_ids|
Gitlab::Git::Blob.batch_lfs_pointers(@repository, object_ids)