diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-03-27 23:39:41 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-03-28 05:26:03 +0300 |
commit | 0f1d8e771f3115c12af9ca6e24ea57b2f403b826 (patch) | |
tree | 8631eb484d5fec54ba182e48c69c84dbb219d13f /spec/support/test_env.rb | |
parent | 3d4c2d0b510f15ac3f0abe6ba4468dd019b06278 (diff) |
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/test_env.rb')
-rw-r--r-- | spec/support/test_env.rb | 8 |
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 |