summaryrefslogtreecommitdiff
path: root/hooks/update
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2014-11-19 11:05:23 +0200
committerValery Sizov <vsv2711@gmail.com>2014-11-19 11:05:23 +0200
commit4157d523994b2fae7908cb93b4e78ee1db763ce7 (patch)
tree06bc2bff6fe829c38c2e0751e42adeb477caf54d /hooks/update
parentb7a1a2520b6d9b5f8d806f18c9a059cdd0d62eae (diff)
downloadgitlab-shell-4157d523994b2fae7908cb93b4e78ee1db763ce7.tar.gz
Revert "Restore hooks PATH before calling ruby."
This reverts commit cd9e796316560eee596f2681d54a8417389bbe79.
Diffstat (limited to 'hooks/update')
-rwxr-xr-xhooks/update20
1 files changed, 16 insertions, 4 deletions
diff --git a/hooks/update b/hooks/update
index 5d8d06d..f1ac8e7 100755
--- a/hooks/update
+++ b/hooks/update
@@ -1,5 +1,17 @@
-#!/usr/bin/env bash
+#!/usr/bin/env ruby
-# Remove paths Git automatically prepends to PATH on hooks.
-export PATH="$GITLAB_PATH_OUTSIDE_HOOK"
-ruby "$GIT_DIR/hooks/update-main.rb"
+# 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