formula: use which over locate
This commit is contained in:
parent
98bb638f29
commit
b808eed08f
@ -768,12 +768,12 @@ class Formula
|
||||
# New Homebrew installs may not be a git repo yet
|
||||
return false unless File.exist? "#{HOMEBREW_PREFIX}/.git"
|
||||
|
||||
git = MacOS.locate("git")
|
||||
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.dirname.to_s == "/usr/bin" && !MacOS.has_apple_developer_tools?
|
||||
return false if git == "/usr/bin/git" && !MacOS.has_apple_developer_tools?
|
||||
|
||||
path.parent.cd do
|
||||
diff = Utils.popen_read("git", "diff", "origin/master", "--", "#{path}")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user