Commit be7c65c6 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'create_hooks_response' into 'master'

Create hooks response

Related to https://dev.gitlab.org/gitlab/gitlabhq/issues/1900

See merge request !52
parents 00230264 16bcdfd7
......@@ -21,9 +21,14 @@ class GitlabProjects
def self.create_hooks(path)
local_hooks_directory = File.join(path, 'hooks')
unless File.realpath(local_hooks_directory) == File.realpath(GLOBAL_HOOKS_DIRECTORY)
if File.realpath(local_hooks_directory) != File.realpath(GLOBAL_HOOKS_DIRECTORY)
$logger.info "Moving existing hooks directory and simlinking global hooks directory for #{path}."
FileUtils.mv(local_hooks_directory, "#{local_hooks_directory}.old.#{Time.now.to_i}")
FileUtils.ln_s(GLOBAL_HOOKS_DIRECTORY, local_hooks_directory)
else
$logger.info "Hooks already exist for #{path}."
true
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