append ? to git_remote_exist

This commit is contained in:
Maxim Belkin 2018-03-14 16:30:45 -05:00
parent 96fd1a8c2a
commit f984701c29
No known key found for this signature in database
GPG Key ID: AC71560D4C5F2338
3 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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