diff options
author | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-01-20 17:12:54 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-01-20 17:12:54 +0000 |
commit | be7c65c650cd1e2ebd427f904a5f7fc74dc1b98d (patch) | |
tree | 85cef7296ff04245e9bc55dd72fd14ae067bf626 | |
parent | 0023026411233b039ea91967be7ec15fe0251a71 (diff) | |
parent | 16bcdfd7c9a34644edb1849c67144750c894ff52 (diff) | |
download | gitlab-shell-be7c65c650cd1e2ebd427f904a5f7fc74dc1b98d.tar.gz |
Merge branch 'create_hooks_response' into 'master'
Create hooks response
Related to https://dev.gitlab.org/gitlab/gitlabhq/issues/1900
See merge request !52
-rw-r--r-- | lib/gitlab_projects.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb index e9c9203..05ee211 100644 --- a/lib/gitlab_projects.rb +++ b/lib/gitlab_projects.rb @@ -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 |