FormulaInstaller: reset git_available? when installing git

Closes Homebrew/homebrew#43693

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Xu Cheng 2015-09-08 16:24:09 +08:00
parent 2b835551d7
commit 3638c057f0
2 changed files with 9 additions and 0 deletions

View File

@ -451,6 +451,9 @@ class FormulaInstaller
ohai "Summary" if verbose? || show_summary_heading? ohai "Summary" if verbose? || show_summary_heading?
puts summary puts summary
# let's reset Utils.git_available? if we just installed git
Utils.clear_git_available_cache if formula.name == "git"
ensure ensure
unlock unlock
end end

View File

@ -21,5 +21,11 @@ module Utils
rescue rescue
raise "Git is unavailable" raise "Git is unavailable"
end 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
end end