diff options
| author | Ciro Santilli <ciro.santilli@gmail.com> | 2014-10-18 22:14:35 +0200 |
|---|---|---|
| committer | Ciro Santilli <ciro.santilli@gmail.com> | 2014-11-17 17:59:35 +0100 |
| commit | cd9e796316560eee596f2681d54a8417389bbe79 (patch) | |
| tree | 0a27a1e345ea81b941651a3b5d37ccc4cc551286 /hooks/post-receive | |
| parent | dbdcc5f400df466944ad5e55e8e03dee55de865f (diff) | |
| download | gitlab-shell-cd9e796316560eee596f2681d54a8417389bbe79.tar.gz | |
Restore hooks PATH before calling ruby.
Diffstat (limited to 'hooks/post-receive')
| -rwxr-xr-x | hooks/post-receive | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/hooks/post-receive b/hooks/post-receive index 301f639..328084a 100755 --- a/hooks/post-receive +++ b/hooks/post-receive @@ -1,18 +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. - -refs = ARGF.read -key_id = ENV['GL_ID'] -repo_path = Dir.pwd - -require_relative '../lib/gitlab_custom_hook' -require_relative '../lib/gitlab_post_receive' - -if GitlabPostReceive.new(repo_path, key_id, refs).exec && - GitlabCustomHook.new.post_receive(refs, 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/post-receive-main.rb" |
