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.
|
||||
@only_path = meta[:only_path]
|
||||
|
||||
# "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.end_with?("/")
|
||||
if @only_path.present?
|
||||
# "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.end_with?("/")
|
||||
end
|
||||
|
||||
super
|
||||
@ref_type ||= :branch
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user