Merge pull request #3925 from maxim-belkin/git_remote_exists_bool
append ? to git_remote_exists
This commit is contained in:
commit
cb6828dbe6
@ -949,7 +949,7 @@ class ResourceAuditor
|
||||
problem http_content_problem
|
||||
end
|
||||
elsif strategy <= GitDownloadStrategy
|
||||
unless Utils.git_remote_exists url
|
||||
unless Utils.git_remote_exists? url
|
||||
problem "The URL #{url} is not a valid git URL"
|
||||
end
|
||||
elsif strategy <= SubversionDownloadStrategy
|
||||
|
||||
@ -121,10 +121,10 @@ describe Utils do
|
||||
end
|
||||
end
|
||||
|
||||
describe "::git_remote_exists" do
|
||||
describe "::git_remote_exists?" do
|
||||
it "returns true when git is not available" do
|
||||
stub_const("HOMEBREW_SHIMS_PATH", HOMEBREW_PREFIX/"bin/shim")
|
||||
expect(described_class.git_remote_exists("blah")).to be_truthy
|
||||
expect(described_class.git_remote_exists?("blah")).to be_truthy
|
||||
end
|
||||
|
||||
context "when git is available" do
|
||||
@ -139,11 +139,11 @@ describe Utils do
|
||||
system git, "remote", "add", "origin", url
|
||||
end
|
||||
|
||||
expect(described_class.git_remote_exists(url)).to be_truthy
|
||||
expect(described_class.git_remote_exists?(url)).to be_truthy
|
||||
end
|
||||
|
||||
it "returns false when git remote does not exist" do
|
||||
expect(described_class.git_remote_exists("blah")).to be_falsey
|
||||
expect(described_class.git_remote_exists?("blah")).to be_falsey
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -67,7 +67,7 @@ module Utils
|
||||
@git_version = nil
|
||||
end
|
||||
|
||||
def self.git_remote_exists(url)
|
||||
def self.git_remote_exists?(url)
|
||||
return true unless git_available?
|
||||
quiet_system "git", "ls-remote", url
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user