summaryrefslogtreecommitdiff
path: root/spec/support/helpers/test_env.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/helpers/test_env.rb')
-rw-r--r--spec/support/helpers/test_env.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb
index 1fef50a52ec..05a8e6206ae 100644
--- a/spec/support/helpers/test_env.rb
+++ b/spec/support/helpers/test_env.rb
@@ -135,6 +135,16 @@ module TestEnv
install_dir: Gitlab.config.gitlab_shell.path,
version: Gitlab::Shell.version_required,
task: 'gitlab:shell:install')
+
+ create_fake_git_hooks
+ end
+
+ def create_fake_git_hooks
+ # gitlab-shell hooks don't work in our test environment because they try to make internal API calls
+ hooks_dir = File.join(Gitlab.config.gitlab_shell.path, 'hooks')
+ %w[pre-receive post-receive update].each do |hook|
+ File.open(File.join(hooks_dir, hook), 'w', 0755) { |f| f.puts '#!/bin/sh' }
+ end
end
def setup_gitaly