From 1d03fa2e7f4d341f17d7ad5dcad4b1f8eda14a60 Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Date: Wed, 10 Apr 2013 15:11:45 +0300
Subject: [PATCH] Run rewrite-hooks after repos restore

---
 lib/backup/repository.rb | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb
index 14e59143250..62a510f2acc 100644
--- a/lib/backup/repository.rb
+++ b/lib/backup/repository.rb
@@ -68,6 +68,15 @@ module Backup
           end
         end
       end
+
+      print 'Put GitLab hooks in repositories dirs'.yellow
+      gitlab_shell_user_home = File.expand_path("~#{Gitlab.config.gitlab_shell.ssh_user}")
+      if system("#{gitlab_shell_user_home}/gitlab-shell/support/rewrite-hooks.sh")
+        puts " [DONE]".green
+      else
+        puts " [FAILED]".red
+      end
+
     end
 
     protected
-- 
GitLab