diff options
| author | Xu Cheng | 2015-09-08 16:24:09 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-09-09 12:22:03 +0800 |
| commit | 3638c057f08d346a64a34016bdacc26a37baf330 (patch) | |
| tree | 8d0fe5a0171e1b30b1a322de5de179f6ee231127 /Library | |
| parent | 2b835551d7f123df111924f3be2ca8465cc9f414 (diff) | |
| download | brew-3638c057f08d346a64a34016bdacc26a37baf330.tar.bz2 | |
FormulaInstaller: reset git_available? when installing git
Closes Homebrew/homebrew#43693
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 3 | ||||
| -rw-r--r-- | Library/Homebrew/utils/git.rb | 6 |
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 |
