Check only_path is present before modifying it
This commit is contained in:
parent
747d3aaaba
commit
d2b17e29ef
@ -835,9 +835,11 @@ class GitDownloadStrategy < VCSDownloadStrategy
|
|||||||
# constructor calls `cache_tag` and sets the cache path.
|
# constructor calls `cache_tag` and sets the cache path.
|
||||||
@only_path = meta[:only_path]
|
@only_path = meta[:only_path]
|
||||||
|
|
||||||
|
if @only_path.present?
|
||||||
# "Cone" mode of sparse checkout requires patterns to be directories
|
# "Cone" mode of sparse checkout requires patterns to be directories
|
||||||
@only_path = "/#{@only_path}" unless @only_path.start_with?("/")
|
@only_path = "/#{@only_path}" unless @only_path.start_with?("/")
|
||||||
@only_path = "#{@only_path}/" unless @only_path.end_with?("/")
|
@only_path = "#{@only_path}/" unless @only_path.end_with?("/")
|
||||||
|
end
|
||||||
|
|
||||||
super
|
super
|
||||||
@ref_type ||= :branch
|
@ref_type ||= :branch
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user