diff options
| author | Jack Nagel | 2013-05-26 17:53:48 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-05-26 17:55:34 -0500 |
| commit | 95119c2deb51b645db409f9dbd8fe5abcf42864a (patch) | |
| tree | 12d11654af132f2a06ae3565d8c7e8f4ca807b79 /Library/Homebrew/cmd/doctor.rb | |
| parent | 1f699a69029fd6b76298d156fbb754ace115b488 (diff) | |
| download | homebrew-95119c2deb51b645db409f9dbd8fe5abcf42864a.tar.bz2 | |
doctor: combine git origin checks
Diffstat (limited to 'Library/Homebrew/cmd/doctor.rb')
| -rw-r--r-- | Library/Homebrew/cmd/doctor.rb | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index cff72a425..1a8033623 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -729,13 +729,13 @@ def check_git_newline_settings end end -def check_for_git_origin - return unless which "git" - # otherwise this will nag users with no repo about their remote - return unless (HOMEBREW_REPOSITORY/'.git').exist? +def check_git_origin + return unless which('git') && (HOMEBREW_REPOSITORY/'.git').exist? HOMEBREW_REPOSITORY.cd do - if `git config --get remote.origin.url`.chomp.empty? then <<-EOS.undent + origin = `git config --get remote.origin.url`.strip + + if origin.empty? then <<-EOS.undent Missing git origin remote. Without a correctly configured origin, Homebrew won't update @@ -743,21 +743,7 @@ def check_for_git_origin cd #{HOMEBREW_REPOSITORY} git remote add origin https://github.com/mxcl/homebrew.git EOS - end - end -end - -def check_the_git_origin - return unless which "git" - return if check_for_git_origin - - # otherwise this will nag users with no repo about their remote - return unless (HOMEBREW_REPOSITORY/'.git').exist? - - HOMEBREW_REPOSITORY.cd do - origin = `git config --get remote.origin.url`.chomp - - unless origin =~ /mxcl\/homebrew(\.git)?$/ then <<-EOS.undent + elsif origin !~ /mxcl\/homebrew(\.git)?$/ then <<-EOS.undent Suspicious git origin remote found. With a non-standard origin, Homebrew won't pull updates from |
