Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-08-02 11:31:00 +0300
committerSean McGivern <sean@mcgivern.me.uk>2018-08-02 11:31:00 +0300
commit28c15d4f94cda8c6635d832d6bde7a131e207023 (patch)
treece4c41aa9c59c1d1ef95486c2874e695bcd28e77 /spec/support
parent9812e5dd7c52e67b22781a440ee04dbb2a086000 (diff)
parent01de2b5df89c4eaca92408c18203050604a4e94f (diff)
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
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/helpers/seed_helper.rb6
-rw-r--r--spec/support/helpers/test_env.rb8
-rw-r--r--spec/support/stored_repositories.rb4
3 files changed, 8 insertions, 10 deletions
diff --git a/spec/support/helpers/seed_helper.rb b/spec/support/helpers/seed_helper.rb
index 8fd107260cc..25781f5e679 100644
--- a/spec/support/helpers/seed_helper.rb
+++ b/spec/support/helpers/seed_helper.rb
@@ -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
diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb
index e531495d917..8e1d4cfe269 100644
--- a/spec/support/helpers/test_env.rb
+++ b/spec/support/helpers/test_env.rb
@@ -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
diff --git a/spec/support/stored_repositories.rb b/spec/support/stored_repositories.rb
index 21995c89a6e..26f823cb6ef 100644
--- a/spec/support/stored_repositories.rb
+++ b/spec/support/stored_repositories.rb
@@ -1,8 +1,4 @@
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