Extract supports_partial_clone_sparse_checkout?

This commit is contained in:
Harry Marr 2022-05-04 11:22:32 -04:00
parent 99504c4474
commit 49e2cf9f92
No known key found for this signature in database
GPG Key ID: EC359447F66859CC
2 changed files with 7 additions and 3 deletions

View File

@ -884,9 +884,7 @@ class GitDownloadStrategy < VCSDownloadStrategy
def partial_clone_sparse_checkout?
return false if @only_paths.blank?
# There is some support for partial clones prior to 2.20, but we avoid using it
# due to performance issues
Version.create(Utils::Git.version) >= Version.create("2.20.0")
Utils::Git.supports_partial_clone_sparse_checkout?
end
sig { returns(T::Array[String]) }

View File

@ -141,5 +141,11 @@ module Utils
raise ErrorDuringExecution.new(cmd, status: $CHILD_STATUS, output: [[:stdout, output]])
end
end
def supports_partial_clone_sparse_checkout?
# There is some support for partial clones prior to 2.20, but we avoid using it
# due to performance issues
Version.create(version) >= Version.create("2.20.0")
end
end
end