From 7192b9707b027a76b70d7ec4d9bac6f6454c2987 Mon Sep 17 00:00:00 2001 From: Nathan Stilwell Date: Thu, 27 Mar 2014 14:24:31 -0400 Subject: [PATCH] using util-eng to install git hooks --- plugins/gerrit/gerrit.plugin.zsh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/gerrit/gerrit.plugin.zsh b/plugins/gerrit/gerrit.plugin.zsh index 01bd34d28..899ee4830 100644 --- a/plugins/gerrit/gerrit.plugin.zsh +++ b/plugins/gerrit/gerrit.plugin.zsh @@ -85,14 +85,15 @@ function gerrit_add_reviewer { } function gerrit_setup () { - cd .git/hooks; - scp gerrit_host:hooks/commit-msg . > /dev/null; - cd - > /dev/null; + if [ -d /web/tools/bin/install-hooks ]; then + # install hooks + /web/tools/bin/install-hooks; - if [[ $? -eq 0 ]]; then - echo "$green Gerrit hook installed. $stop"; - else - echo "$red Couldn't install Gerrit hook. $stop"; + if [[ $? -eq 0 ]]; then + echo "$green Gerrit hook installed. $stop"; + else + echo "$red Couldn't install Gerrit hook. $stop"; + fi fi }