Commit 2d774eea authored by Dirk Hörner's avatar Dirk Hörner Committed by Sean McGivern

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.
parent d4f2f5ba
...@@ -56,6 +56,6 @@ class GitlabCustomHook ...@@ -56,6 +56,6 @@ class GitlabCustomHook
def hook_file(hook_type, repo_path) def hook_file(hook_type, repo_path)
hook_path = File.join(repo_path.strip, 'custom_hooks') hook_path = File.join(repo_path.strip, 'custom_hooks')
hook_file = "#{hook_path}/#{hook_type}" hook_file = "#{hook_path}/#{hook_type}"
hook_file if File.exist?(hook_file) hook_file if File.executable?(hook_file)
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment