Method: Bundler::SharedHelpers#with_clean_git_env
- Defined in:
- lib/bundler/shared_helpers.rb
#with_clean_git_env(&block) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/bundler/shared_helpers.rb', line 64 def with_clean_git_env(&block) keys = %w[GIT_DIR GIT_WORK_TREE] old_env = keys.inject({}) do |h, k| h.update(k => ENV[k]) end keys.each {|key| ENV.delete(key) } block.call ensure keys.each {|key| ENV[key] = old_env[key] } end |