Formula#file_modified?: use Utils.git_available?

This commit is contained in:
Xu Cheng 2015-09-01 16:55:35 +08:00
parent 8d5c445daa
commit faa6334774

View File

@ -918,13 +918,7 @@ class Formula
# @private
def file_modified?
git = which("git")
# git isn't installed by older Xcodes
return false if git.nil?
# /usr/bin/git is a popup stub when Xcode/CLT aren't installed, so bail out
return false if git == "/usr/bin/git" && !MacOS.has_apple_developer_tools?
return false unless Utils.git_available?
path.parent.cd do
diff = Utils.popen_read("git", "diff", "origin/master", "--", "#{path}")