summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/post-receive21
-rw-r--r--hooks/post-receive-main.rb18
-rwxr-xr-xhooks/pre-receive21
-rwxr-xr-xhooks/pre-receive-main.rb18
-rwxr-xr-xhooks/update20
-rwxr-xr-xhooks/update-main.rb17
6 files changed, 50 insertions, 65 deletions
diff --git a/hooks/post-receive b/hooks/post-receive
index 328084a..301f639 100755
--- a/hooks/post-receive
+++ b/hooks/post-receive
@@ -1,5 +1,18 @@
-#!/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/post-receive-main.rb"
+# 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
diff --git a/hooks/post-receive-main.rb b/hooks/post-receive-main.rb
deleted file mode 100644
index 301f639..0000000
--- a/hooks/post-receive-main.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env ruby
-
-# 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
diff --git a/hooks/pre-receive b/hooks/pre-receive
index 420a046..7f9c0c0 100755
--- a/hooks/pre-receive
+++ b/hooks/pre-receive
@@ -1,5 +1,18 @@
-#!/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/pre-receive-main.rb"
+# 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_access'
+
+if GitlabAccess.new(repo_path, key_id, refs).exec &&
+ GitlabCustomHook.new.pre_receive(refs, repo_path)
+ exit 0
+else
+ exit 1
+end
diff --git a/hooks/pre-receive-main.rb b/hooks/pre-receive-main.rb
deleted file mode 100755
index 7f9c0c0..0000000
--- a/hooks/pre-receive-main.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env ruby
-
-# 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_access'
-
-if GitlabAccess.new(repo_path, key_id, refs).exec &&
- GitlabCustomHook.new.pre_receive(refs, repo_path)
- exit 0
-else
- exit 1
-end
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
diff --git a/hooks/update-main.rb b/hooks/update-main.rb
deleted file mode 100755
index f1ac8e7..0000000
--- a/hooks/update-main.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env ruby
-
-# 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