From a6bd784f55f11c98d34366ae23565330dd3b6517 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 26 Aug 2020 05:41:58 +0200 Subject: [PATCH] Unset `HOMEBREW_TEST_GENERIC_OS` when installing Git. --- Library/Homebrew/utils/git.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/utils/git.rb b/Library/Homebrew/utils/git.rb index 5925a7b07f..334a2c7281 100644 --- a/Library/Homebrew/utils/git.rb +++ b/Library/Homebrew/utils/git.rb @@ -93,8 +93,14 @@ module Utils if CoreTap.instance.installed? begin oh1 "Installing #{Formatter.identifier("git")}" - safe_system HOMEBREW_BREW_FILE, "install", "git" - clear_available_cache + + # We need to unset `HOMEBREW_TEST_GENERIC_OS`, otherwise `git` will be + # installed from source in tests that need it. This is slow and will + # also likely fail due to `OS::Linux` and `OS::Mac` being undefined. + with_env "HOMEBREW_TEST_GENERIC_OS" => nil do + safe_system HOMEBREW_BREW_FILE, "install", "git" + clear_available_cache + end rescue raise "Git is unavailable" end