Skip to content

Commit

Permalink
Merge pull request #7814 from MikeMcQuaid/shims-scm-svn
Browse files Browse the repository at this point in the history
shims/scm: handle missing Subversion on Catalina.
  • Loading branch information
MikeMcQuaid authored Jun 24, 2020
2 parents 1dbbb5e + c250227 commit 176c85d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Library/Homebrew/shims/scm/git
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ fi
path="/Applications/Xcode.app/Contents/Developer/usr/bin/$SCM_FILE"
safe_exec "$path" "$@"

path="/usr/bin/$SCM_FILE"
[[ -z "$popup_stub" ]] && safe_exec "$path" "$@"
if [[ -z "$popup_stub" && "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101500" ]]
then
path="/usr/bin/$SCM_FILE"
safe_exec "$path" "$@"
fi

echo "You must: brew install $SCM_FILE" >&2
exit 1
2 changes: 2 additions & 0 deletions Library/Homebrew/test/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@
end

config.before(:each, :needs_svn) do
skip "subversion not installed." unless quiet_system "#{HOMEBREW_SHIMS_PATH}/scm/svn", "--version"

svn_paths = PATH.new(ENV["PATH"])
if OS.mac?
xcrun_svn = Utils.popen_read("xcrun", "-f", "svn")
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/utils/svn_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
end

it "returns svn version if svn available" do
if File.executable? "/usr/bin/svn"
if quiet_system "#{HOMEBREW_SHIMS_PATH}/scm/svn", "--version"
expect(described_class).to be_svn_available
else
expect(described_class).not_to be_svn_available
Expand Down

0 comments on commit 176c85d

Please sign in to comment.