aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula_installer.rb3
-rw-r--r--Library/Homebrew/utils/git.rb6
2 files changed, 9 insertions, 0 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index fb2c023d2..f9c1ae42a 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -451,6 +451,9 @@ class FormulaInstaller
ohai "Summary" if verbose? || show_summary_heading?
puts summary
+
+ # let's reset Utils.git_available? if we just installed git
+ Utils.clear_git_available_cache if formula.name == "git"
ensure
unlock
end
diff --git a/Library/Homebrew/utils/git.rb b/Library/Homebrew/utils/git.rb
index 10dbc83c1..74ad49ffe 100644
--- a/Library/Homebrew/utils/git.rb
+++ b/Library/Homebrew/utils/git.rb
@@ -21,5 +21,11 @@ module Utils
rescue
raise "Git is unavailable"
end
+
+ raise "Git is unavailable" unless git_available?
+ end
+
+ def self.clear_git_available_cache
+ remove_instance_variable(:@git) if instance_variable_defined?(:@git)
end
end