# don't use that config setting here, though: it doesn't seem
# worth the risk of stepping on a real git repo root.)
@tmpdir = Rails.root.join 'tmp', 'git'
FileUtils.mkdir_p @tmpdir
system("tar", "-xC", @tmpdir.to_s, "-f", "test/test.git.tar")
# don't use that config setting here, though: it doesn't seem
# worth the risk of stepping on a real git repo root.)
@tmpdir = Rails.root.join 'tmp', 'git'
FileUtils.mkdir_p @tmpdir
system("tar", "-xC", @tmpdir.to_s, "-f", "test/test.git.tar")
- Rails.configuration.git_repositories_dir = "#{@tmpdir}/test"
-
- intdir = Rails.configuration.git_internal_dir
- if not File.exist? intdir
- FileUtils.mkdir_p intdir
- IO.read("|git --git-dir #{intdir.to_s.shellescape} init")
- assert $?.success?
- end
+ Rails.configuration.Git.Repositories = "#{@tmpdir}/test"
+ Rails.configuration.Containers.JobsAPI.GitInternalDir = "#{@tmpdir}/internal.git"
- FileUtils.remove_entry @tmpdir, true
- FileUtils.remove_entry Commit.cache_dir_base, true
+ FileUtils.remove_entry CommitsHelper.cache_dir_base, true
+ FileUtils.mkdir_p @tmpdir
+ system("tar", "-xC", @tmpdir.to_s, "-f", "test/test.git.tar")
- Commit.unstub(:fetch_remote_repository)
- Commit.fetch_remote_repository gitdir, fakeurl
+ CommitsHelper.unstub(:fetch_remote_repository)
+ CommitsHelper.fetch_remote_repository gitdir, fakeurl