From ea2bd9cb4f8ec9652eea8122f75f059f4a71c9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Javier=20L=C3=B3pez?= Date: Thu, 7 Jun 2018 15:49:01 +0000 Subject: [PATCH] Add git filter flag only if it is supported --- lib/gitlab/git/lfs_changes.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/gitlab/git/lfs_changes.rb b/lib/gitlab/git/lfs_changes.rb index 320b2ad007b..b230289e7bf 100644 --- a/lib/gitlab/git/lfs_changes.rb +++ b/lib/gitlab/git/lfs_changes.rb @@ -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) -- GitLab