diff options
author | Dirk Hörner <dirker@gmail.com> | 2016-09-05 10:44:18 +0200 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-12-01 11:40:11 +0000 |
commit | 2d774eeae8ccfb211cc6ab6aeab5db600f3fdc7c (patch) | |
tree | a36007f1fbfb4a9c29b1aa002c6422d5f240d328 | |
parent | d4f2f5bae9808dd08b67f04cf928dab3a5f04f13 (diff) | |
download | gitlab-shell-2d774eeae8ccfb211cc6ab6aeab5db600f3fdc7c.tar.gz |
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.
-rw-r--r-- | lib/gitlab_custom_hook.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |