diff options
Diffstat (limited to 'tool/lib/vcs.rb')
-rw-r--r-- | tool/lib/vcs.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb index 5154a7298e..29be8db3b4 100644 --- a/tool/lib/vcs.rb +++ b/tool/lib/vcs.rb @@ -460,10 +460,13 @@ class VCS end def without_gitconfig - home = ENV.delete('HOME') + envs = %w'HOME XDG_CONFIG_HOME GIT_SYSTEM_CONFIG GIT_CONFIG_SYSTEM'.each_with_object({}) do |v, h| + h[v] = ENV.delete(v) + ENV[v] = NullDevice if v.start_with?('GIT_') + end yield ensure - ENV['HOME'] = home if home + ENV.update(envs) end def initialize(*) |