aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2013-05-26 17:48:12 -0500
committerJack Nagel2013-05-26 17:48:12 -0500
commit255c6e7c3fb34fbf8bd8899a051beec930fc7a4d (patch)
tree1e615574b98c3c6a174efe05693a8b8ff768992a
parent68b3e6f3fb4947076b94a7c0ab09281a8f19fda4 (diff)
downloadbrew-255c6e7c3fb34fbf8bd8899a051beec930fc7a4d.tar.bz2
doctor: combine git existence and version checks
-rw-r--r--Library/Homebrew/cmd/doctor.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 5c9e1a9ae..cff72a425 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -687,8 +687,22 @@ def check_filesystem_case_sensitive
EOS
end
+def __check_git_version
+ # https://help.github.com/articles/https-cloning-errors
+ `git --version`.chomp =~ /git version ((?:\d+\.?)+)/
+
+ if Version.new($1) < Version.new("1.7.10") then <<-EOS.undent
+ An outdated version of Git was detected in your PATH.
+ Git 1.7.10 or newer is required to perform checkouts over HTTPS from GitHub.
+ Please upgrade: brew upgrade git
+ EOS
+ end
+end
+
def check_for_git
- unless which "git" then <<-EOS.undent
+ if which "git"
+ __check_git_version
+ else <<-EOS.undent
Git could not be found in your PATH.
Homebrew uses Git for several internal functions, and some formulae use Git
checkouts instead of stable tarballs. You may want to install Git:
@@ -902,20 +916,6 @@ def check_for_leopard_ssl
end
end
-def check_git_version
- # https://help.github.com/articles/https-cloning-errors
- return unless which "git"
-
- `git --version`.chomp =~ /git version ((?:\d+\.?)+)/
-
- if Version.new($1) < Version.new("1.7.10") then <<-EOS.undent
- An outdated version of Git was detected in your PATH.
- Git 1.7.10 or newer is required to perform checkouts over HTTPS from GitHub.
- Please upgrade: brew upgrade git
- EOS
- end
-end
-
def check_for_enthought_python
if which "enpkg" then <<-EOS.undent
Enthought Python was found in your PATH.