method
with_clean_git_env
v2_6_3 -
Show latest stable
- Class:
Bundler::SharedHelpers
with_clean_git_env(&block)public
No documentation available.
# File lib/bundler/shared_helpers.rb, line 75
def with_clean_git_env(&block)
keys = ]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