diff options
-rwxr-xr-x | tool/test/test_sync_default_gems.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tool/test/test_sync_default_gems.rb b/tool/test/test_sync_default_gems.rb index 8e667fc4d2..39eab3f205 100755 --- a/tool/test/test_sync_default_gems.rb +++ b/tool/test/test_sync_default_gems.rb @@ -80,7 +80,8 @@ module Test_SyncDefaultGems @target = nil pend "No git" unless system("git --version", out: IO::NULL) @testdir = Dir.mktmpdir("sync") - @git_config = ENV["GIT_CONFIG_GLOBAL"] + @git_config = %W"HOME GIT_CONFIG_GLOBAL".each_with_object({}) {|k, c| c[k] = ENV[k]} + ENV["HOME"] = @testdir ENV["GIT_CONFIG_GLOBAL"] = @testdir + "/gitconfig" system(*%W"git config --global user.email test@ruby-lang.org") system(*%W"git config --global user.name", "Ruby") @@ -105,7 +106,7 @@ module Test_SyncDefaultGems if @target Dir.chdir(@origdir) SyncDefaultGems::REPOSITORIES.delete(@target.to_sym) - ENV["GIT_CONFIG_GLOBAL"] = @git_config + ENV.update(@git_config) FileUtils.rm_rf(@testdir) end super |