Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shims/scm: handle missing Subversion on Catalina. #7814

Merged
merged 3 commits into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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