aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Muschol2017-08-25 20:25:58 -0400
committerBen Muschol2017-08-25 20:25:58 -0400
commitabe47b79c898c49d762df5d0f52541722e8e202c (patch)
tree5507fc80a50d3fb60535164004925a670c4a9985
parent6d393decfe8099cb049c0ee62c6dc5877e54c0d7 (diff)
downloadbrew-abe47b79c898c49d762df5d0f52541722e8e202c.tar.bz2
Add check for HEAD ref in diagnostics
-rw-r--r--Library/Homebrew/diagnostic.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb
index ceb6ad4d1..55124b91e 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,22 @@ module Homebrew
git -C "#{coretap_path}" remote set-url origin #{Formatter.url("https://github.com/Homebrew/homebrew-core.git")}
EOS
end
+
+ head = coretap_path.head
+ return unless head && head !~ %r{refs/heads/master}
+
+ <<-EOS.undent
+ Suspicious #{CoreTap.instance} git head found.
+
+ With a non-standard head, your local version of Homebrew might not
+ have all of the changes intended for the most recent release. The
+ current git head is:
+ #{head}
+
+ Unless you have compelling reasons, consider setting the head to
+ point at the master branch by running:
+ git checkout master
+ EOS
end
def __check_linked_brew(f)