From 7292ad1f1a1f8f92bac9160b6be6c4a64ac24d5c Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 16 Oct 2016 14:14:23 +0100 Subject: [PATCH] shims/scm/git: fix on old OS X versions. On older versions of OS X (i.e. pre-Mavericks) `xcode-select` is not required to be set when using the CLT. Fix this behaviour so `brew update` doesn't tell everyone on that configuration to `brew install git`. --- Library/Homebrew/shims/scm/git | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/shims/scm/git b/Library/Homebrew/shims/scm/git index eedca486bc..96209df23a 100755 --- a/Library/Homebrew/shims/scm/git +++ b/Library/Homebrew/shims/scm/git @@ -111,7 +111,15 @@ then # /usr/bin/ will be a popup stub under such configuration. # xcrun hangs if xcode-select is set to "/" xcode_path="$(/usr/bin/xcode-select -print-path 2>/dev/null)" - [[ -n "$xcode_path" ]] || popup_stub=1 + if [[ -z "$xcode_path" ]] + then + macos_version="$(/usr/bin/sw_vers -productVersion)" + printf -v macos_version_numeric "%02d%02d%02d" ${macos_version//./ } + if [[ "$macos_version_numeric" -ge "100900" ]] + then + unset popup_stub=1 + fi + fi if [[ -z "$popup_stub" && "$xcode_path" != "/" ]] then path="$(/usr/bin/xcrun -find "$SCM_FILE" 2>/dev/null)"