diff options
| author | Jack Nagel | 2013-05-26 17:53:48 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-05-26 17:55:34 -0500 |
| commit | 00548b81ce53dede914937b1e19ba1188c3ee3ea (patch) | |
| tree | 3ca500d18503c07710a980b80cfbd65751f5e9d3 /Library | |
| parent | 255c6e7c3fb34fbf8bd8899a051beec930fc7a4d (diff) | |
| download | brew-00548b81ce53dede914937b1e19ba1188c3ee3ea.tar.bz2 | |
doctor: combine git origin checks
Diffstat (limited to 'Library')
| -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 |
