summaryrefslogtreecommitdiff
path: root/lib/gitlab/git/repository.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-09-19 17:25:42 +0200
committerRobert Speicher <rspeicher@gmail.com>2017-12-22 08:34:44 -0600
commita2d39b80109f006ff63752cfaed5e458f9443d1d (patch)
treecc5a0f06ba04448dbf025dd95a6e39686343d256 /lib/gitlab/git/repository.rb
parent299e04e318728d4ee5857379f8fb350c944a0b4e (diff)
downloadgitlab-ce-a2d39b80109f006ff63752cfaed5e458f9443d1d.tar.gz
Use gitlab-styles
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/gitlab/git/repository.rb')
-rw-r--r--lib/gitlab/git/repository.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index 044c60caa05..603323d0452 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -56,11 +56,12 @@ module Gitlab
# Do nothing if hooks already exist
unless real_local_hooks_path == File.realpath(global_hooks_path)
- # Move the existing hooks somewhere safe
- FileUtils.mv(
- local_hooks_path,
- "#{local_hooks_path}.old.#{Time.now.to_i}"
- ) if File.exist?(local_hooks_path)
+ if File.exist?(local_hooks_path)
+ # Move the existing hooks somewhere safe
+ FileUtils.mv(
+ local_hooks_path,
+ "#{local_hooks_path}.old.#{Time.now.to_i}")
+ end
# Create the hooks symlink
FileUtils.ln_sf(global_hooks_path, local_hooks_path)