summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2018-06-08 15:08:55 +0200
committerJacob Vosmaer <jacob@gitlab.com>2018-06-08 15:08:55 +0200
commitf6c79564baae71487080e62b1bcc2ef628f33150 (patch)
treedf191b36f1b7b5911ecf4a32387da02c2b09f081
parentd962b6867de4a953ecbd2c12339e078a250698c1 (diff)
downloadgitlab-ce-f6c79564baae71487080e62b1bcc2ef628f33150.tar.gz
Use empty but executable hooks
-rw-r--r--spec/support/helpers/test_env.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb
index 4a73145cc93..9c29697704c 100644
--- a/spec/support/helpers/test_env.rb
+++ b/spec/support/helpers/test_env.rb
@@ -138,8 +138,9 @@ module TestEnv
# 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')
- FileUtils.rm_rf(hooks_dir)
- FileUtils.mkdir_p(hooks_dir)
+ %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