Commit a0dd2445 authored by Samuel Giddins's avatar Samuel Giddins

Merge pull request #7768 from CocoaPods/segiddins/defensive-version-creation

Be defensive when passing potentially nil strings to Gem::Version

(cherry picked from commit 04cbea4d)
parent bbb438a1
......@@ -114,7 +114,9 @@ module Pod
#
def self.git_version
raw_version = Executable.capture_command('git', ['--version']).first
match = raw_version.scan(/\d+\.\d+\.\d+/).first
unless match = raw_version.scan(/\d+\.\d+\.\d+/).first
raise "Failed to extract git version from `git --version` (#{raw_version.inspect})"
end
Gem::Version.new(match)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment