summaryrefslogtreecommitdiff
path: root/hooks/update
diff options
context:
space:
mode:
authorCiro Santilli <ciro.santilli@gmail.com>2014-10-18 22:14:35 +0200
committerCiro Santilli <ciro.santilli@gmail.com>2014-11-17 17:59:35 +0100
commitcd9e796316560eee596f2681d54a8417389bbe79 (patch)
tree0a27a1e345ea81b941651a3b5d37ccc4cc551286 /hooks/update
parentdbdcc5f400df466944ad5e55e8e03dee55de865f (diff)
downloadgitlab-shell-cd9e796316560eee596f2681d54a8417389bbe79.tar.gz
Restore hooks PATH before calling ruby.
Diffstat (limited to 'hooks/update')
-rwxr-xr-xhooks/update20
1 files changed, 4 insertions, 16 deletions
diff --git a/hooks/update b/hooks/update
index f1ac8e7..5d8d06d 100755
--- a/hooks/update
+++ b/hooks/update
@@ -1,17 +1,5 @@
-#!/usr/bin/env ruby
+#!/usr/bin/env bash
-# This file was placed here by GitLab. It makes sure that your pushed commits
-# will be processed properly.
-
-ref_name = ARGV[0]
-old_value = ARGV[1]
-new_value = ARGV[2]
-repo_path = Dir.pwd
-
-require_relative '../lib/gitlab_custom_hook'
-
-if GitlabCustomHook.new.update(ref_name, old_value, new_value, repo_path)
- exit 0
-else
- exit 1
-end
+# Remove paths Git automatically prepends to PATH on hooks.
+export PATH="$GITLAB_PATH_OUTSIDE_HOOK"
+ruby "$GIT_DIR/hooks/update-main.rb"