From 82eaabf7fe852ea0304fb1bc9ca8454ef3cc52a2 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Sat, 14 Jun 2025 01:54:12 +0100 Subject: [PATCH] api_hashable: retain access to global gitconfig --- Library/Homebrew/api_hashable.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Library/Homebrew/api_hashable.rb b/Library/Homebrew/api_hashable.rb index e1e4098e95..c520d6ff65 100644 --- a/Library/Homebrew/api_hashable.rb +++ b/Library/Homebrew/api_hashable.rb @@ -10,9 +10,11 @@ module APIHashable @old_homebrew_prefix = HOMEBREW_PREFIX @old_homebrew_cellar = HOMEBREW_CELLAR @old_home = Dir.home + @old_git_config_global = ENV.fetch("GIT_CONFIG_GLOBAL", nil) Object.send(:remove_const, :HOMEBREW_PREFIX) Object.const_set(:HOMEBREW_PREFIX, Pathname.new(HOMEBREW_PREFIX_PLACEHOLDER)) ENV["HOME"] = HOMEBREW_HOME_PLACEHOLDER + ENV["GIT_CONFIG_GLOBAL"] = File.join(@old_home, ".gitconfig") @generating_hash = true end @@ -24,6 +26,7 @@ module APIHashable Object.send(:remove_const, :HOMEBREW_PREFIX) Object.const_set(:HOMEBREW_PREFIX, @old_homebrew_prefix) ENV["HOME"] = @old_home + ENV["GIT_CONFIG_GLOBAL"] = @old_git_config_global @generating_hash = false end