aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2017-08-26 14:12:05 +0100
committerGitHub2017-08-26 14:12:05 +0100
commitdb8af67aa376f131ef945f2ce9ebb39ad41bf96d (patch)
treee870bf82975c07a0a9a2e8d8154fc730eb95a050
parenta9d63745ef9f89ebbd3080e20954f1de1fadad51 (diff)
parent7b31dd606288cbd976015efde61b6a6e2eb17a38 (diff)
downloadbrew-db8af67aa376f131ef945f2ce9ebb39ad41bf96d.tar.bz2
Merge pull request #3089 from BenMusch/check-for-branch
Add check for HEAD ref in diagnostics
-rw-r--r--Library/Homebrew/diagnostic.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb
index ceb6ad4d1..8108c5da0 100644
--- a/Library/Homebrew/diagnostic.rb
+++ b/Library/Homebrew/diagnostic.rb
@@ -756,7 +756,7 @@ module Homebrew
end
end
- def check_coretap_git_origin
+ def check_coretap_git_config
coretap_path = CoreTap.instance.path
return if !Utils.git_available? || !(coretap_path/".git").exist?
@@ -785,6 +785,16 @@ module Homebrew
git -C "#{coretap_path}" remote set-url origin #{Formatter.url("https://github.com/Homebrew/homebrew-core.git")}
EOS
end
+
+ head = coretap_path.git_head
+ return if head.nil? || head =~ %r{refs/heads/master}
+
+ <<-EOS.undent
+ Homebrew/homebrew-core is not on the master branch
+
+ Check out the master branch by running:
+ git -C "$(brew --repo homebrew/core)" checkout master
+ EOS
end
def __check_linked_brew(f)