Skip to content
Snippets Groups Projects
Commit 28c15d4f authored by Sean McGivern's avatar Sean McGivern
Browse files

Merge branch 'gitaly-import-bare' into 'master'

Refactor gitlab:import:repos task to remove direct disk access

Closes gitaly#953

See merge request gitlab-org/gitlab-ce!20864
parents 9812e5dd 01de2b5d
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
require "spec_helper"
 
describe Gitlab::Git::Tree, seed_helper: true do
describe Gitlab::Git::Tree, :seed_helper do
let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '') }
 
context :repo do
Loading
Loading
Loading
Loading
@@ -101,10 +101,4 @@ bla/bla.txt
handle.write('# hello'.encode(enc))
end
end
# Prevent developer git configurations from being persisted to test
# repositories
def git_env
{ 'GIT_TEMPLATE_DIR' => '' }
end
end
Loading
Loading
@@ -243,6 +243,14 @@ module TestEnv
set_repo_refs(target_repo_path, refs)
end
 
def create_bare_repository(path)
FileUtils.mkdir_p(path)
system(git_env, *%W(#{Gitlab.config.git.bin_path} -C #{path} init --bare),
out: '/dev/null',
err: '/dev/null')
end
def repos_path
@repos_path ||= Gitlab.config.repositories.storages[REPOS_STORAGE].legacy_disk_path
end
Loading
Loading
RSpec.configure do |config|
config.before(:each, :repository) do
TestEnv.clean_test_path
end
config.before(:all, :broken_storage) do
FileUtils.rm_rf Gitlab.config.repositories.storages.broken.legacy_disk_path
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment