summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-03-27 16:39:41 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-03-27 22:26:03 -0400
commit0f1d8e771f3115c12af9ca6e24ea57b2f403b826 (patch)
tree8631eb484d5fec54ba182e48c69c84dbb219d13f /spec/support
parent3d4c2d0b510f15ac3f0abe6ba4468dd019b06278 (diff)
downloadgitlab-ce-0f1d8e771f3115c12af9ca6e24ea57b2f403b826.tar.gz
Define GIT_TEMPLATE_DIR environment variable in TestEnv
See http://schacon.github.io/git/git-init.html#_template_directory Without this variable, any global git hooks a developer might have in ~/.git_template would be linked in the `.git/hooks` folder for every test repository that gets checked out by TestEnv, and would cause certain specs to fail due to pre-existing hook files.
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/test_env.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb
index f869488d8d8..44d70e741b2 100644
--- a/spec/support/test_env.rb
+++ b/spec/support/test_env.rb
@@ -85,7 +85,7 @@ module TestEnv
end
# We must copy bare repositories because we will push to them.
- system(*%W(git clone -q --bare #{factory_repo_path} #{factory_repo_path_bare}))
+ system(git_env, *%W(git clone -q --bare #{factory_repo_path} #{factory_repo_path_bare}))
end
def copy_repo(project)
@@ -113,4 +113,10 @@ module TestEnv
def factory_repo_name
'gitlab-test'
end
+
+ # Prevent developer git configurations from being persisted to test
+ # repositories
+ def git_env
+ {'GIT_TEMPLATE_DIR' => ''}
+ end
end