GitDownloadStrategy: move constant to top of class body
This commit is contained in:
parent
eabe9dc6d0
commit
df9a8a3365
@ -464,6 +464,13 @@ class UnsafeSubversionDownloadStrategy < SubversionDownloadStrategy
|
|||||||
end
|
end
|
||||||
|
|
||||||
class GitDownloadStrategy < VCSDownloadStrategy
|
class GitDownloadStrategy < VCSDownloadStrategy
|
||||||
|
SHALLOW_CLONE_WHITELIST = [
|
||||||
|
%r{git://},
|
||||||
|
%r{https://github\.com},
|
||||||
|
%r{http://git\.sv\.gnu\.org},
|
||||||
|
%r{http://llvm\.org},
|
||||||
|
]
|
||||||
|
|
||||||
def cache_tag; "git" end
|
def cache_tag; "git" end
|
||||||
|
|
||||||
def fetch
|
def fetch
|
||||||
@ -515,13 +522,6 @@ class GitDownloadStrategy < VCSDownloadStrategy
|
|||||||
@ref_type != :revision and host_supports_depth?
|
@ref_type != :revision and host_supports_depth?
|
||||||
end
|
end
|
||||||
|
|
||||||
SHALLOW_CLONE_WHITELIST = [
|
|
||||||
%r{git://},
|
|
||||||
%r{https://github\.com},
|
|
||||||
%r{http://git\.sv\.gnu\.org},
|
|
||||||
%r{http://llvm\.org},
|
|
||||||
]
|
|
||||||
|
|
||||||
def host_supports_depth?
|
def host_supports_depth?
|
||||||
SHALLOW_CLONE_WHITELIST.any? { |rx| rx === @url }
|
SHALLOW_CLONE_WHITELIST.any? { |rx| rx === @url }
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user