From 2d774eeae8ccfb211cc6ab6aeab5db600f3fdc7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20H=C3=B6rner?= Date: Mon, 5 Sep 2016 10:44:18 +0200 Subject: custom_hook: only execute hook if file is executable This commit fixes an issue where an existing but unexecutable hook would cause an uncaught execption. --- lib/gitlab_custom_hook.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/gitlab_custom_hook.rb') diff --git a/lib/gitlab_custom_hook.rb b/lib/gitlab_custom_hook.rb index 25385cf..e84d702 100644 --- a/lib/gitlab_custom_hook.rb +++ b/lib/gitlab_custom_hook.rb @@ -56,6 +56,6 @@ class GitlabCustomHook def hook_file(hook_type, repo_path) hook_path = File.join(repo_path.strip, 'custom_hooks') hook_file = "#{hook_path}/#{hook_type}" - hook_file if File.exist?(hook_file) + hook_file if File.executable?(hook_file) end end -- cgit v1.2.1