Skip to content

Commit 52dae28

Browse files
committed
Customize environment
1 parent 8f53289 commit 52dae28

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/units/test_merge.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,19 @@ def setup
6969
# end
7070
# end
7171

72+
def env
73+
ENV.to_h.tap do |env|
74+
env['GIT_DIR'] = git_dir
75+
env['GIT_WORK_TREE'] = work_dir
76+
env['GIT_SSH'] = Git::Base.config.git_ssh
77+
end
78+
end
79+
7280
def command(cmd)
7381
puts '-' * 80
7482
puts "Running: #{cmd}"
7583
puts '-' * 10
76-
output, status = Open3.capture2e("#{cmd} 2>&1")
84+
output, status = Open3.capture2e(env, "#{cmd} 2>&1", unsetenv_others: false)
7785
puts output
7886
puts '-' * 10
7987
pp status

0 commit comments

Comments
 (0)