summaryrefslogtreecommitdiff
path: root/hooks/update-main.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-11-18 12:29:08 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-11-18 12:29:08 +0200
commit53fed51b87305cd89e29ecfc52ed016cb84f3106 (patch)
tree0a27a1e345ea81b941651a3b5d37ccc4cc551286 /hooks/update-main.rb
parentdbdcc5f400df466944ad5e55e8e03dee55de865f (diff)
parentcd9e796316560eee596f2681d54a8417389bbe79 (diff)
downloadgitlab-shell-53fed51b87305cd89e29ecfc52ed016cb84f3106.tar.gz
Merge pull request #186 from cirosantilli/restore-path
Restore hooks PATH before calling ruby.
Diffstat (limited to 'hooks/update-main.rb')
-rwxr-xr-xhooks/update-main.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/hooks/update-main.rb b/hooks/update-main.rb
new file mode 100755
index 0000000..f1ac8e7
--- /dev/null
+++ b/hooks/update-main.rb
@@ -0,0 +1,17 @@
+#!/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