Use different cache tag for sparse checkouts
This commit is contained in:
parent
49e2cf9f92
commit
6219cd0a92
@ -811,10 +811,13 @@ end
|
|||||||
# @api public
|
# @api public
|
||||||
class GitDownloadStrategy < VCSDownloadStrategy
|
class GitDownloadStrategy < VCSDownloadStrategy
|
||||||
def initialize(url, name, version, **meta)
|
def initialize(url, name, version, **meta)
|
||||||
|
# Needs to be before the call to `super`, as the VCSDownloadStrategy's
|
||||||
|
# constructor calls `cache_tag` and sets the cache path.
|
||||||
|
@only_paths = meta[:only_paths]
|
||||||
|
|
||||||
super
|
super
|
||||||
@ref_type ||= :branch
|
@ref_type ||= :branch
|
||||||
@ref ||= "master"
|
@ref ||= "master"
|
||||||
@only_paths = meta[:only_paths]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# @see AbstractDownloadStrategy#source_modified_time
|
# @see AbstractDownloadStrategy#source_modified_time
|
||||||
@ -837,7 +840,11 @@ class GitDownloadStrategy < VCSDownloadStrategy
|
|||||||
|
|
||||||
sig { returns(String) }
|
sig { returns(String) }
|
||||||
def cache_tag
|
def cache_tag
|
||||||
"git"
|
if partial_clone_sparse_checkout?
|
||||||
|
"git-sparse"
|
||||||
|
else
|
||||||
|
"git"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { returns(Integer) }
|
sig { returns(Integer) }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user