summaryrefslogtreecommitdiff
path: root/lib/gitlab_custom_hook.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-06 12:41:38 +0200
committerDouwe Maan <douwe@gitlab.com>2015-04-06 13:10:10 +0200
commite8403e8bb7c5c9109af83a183943d5361ad1409b (patch)
tree0fe3e73b6695816c3ce0a8f01f9fb8cac29a1a9f /lib/gitlab_custom_hook.rb
parentf64e5d4a075479846f2e18bb34b84eb26d180f57 (diff)
downloadgitlab-shell-e8403e8bb7c5c9109af83a183943d5361ad1409b.tar.gz
Move setting/unsetting of GL_ID from lib to executables.
Diffstat (limited to 'lib/gitlab_custom_hook.rb')
-rw-r--r--lib/gitlab_custom_hook.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/gitlab_custom_hook.rb b/lib/gitlab_custom_hook.rb
index a099e79..ac6837d 100644
--- a/lib/gitlab_custom_hook.rb
+++ b/lib/gitlab_custom_hook.rb
@@ -4,24 +4,21 @@ class GitlabCustomHook
def pre_receive(changes, repo_path)
hook = hook_file('pre-receive', repo_path)
return true if hook.nil?
- if call_receive_hook(hook, changes)
- return true
- else
- # reset GL_ID env since we stop git push here
- ENV['GL_ID'] = nil
- return false
- end
+
+ call_receive_hook(hook, changes)
end
def post_receive(changes, repo_path)
hook = hook_file('post-receive', repo_path)
return true if hook.nil?
- call_receive_hook(hook, changes) ? true : false
+
+ call_receive_hook(hook, changes)
end
def update(ref_name, old_value, new_value, repo_path)
hook = hook_file('update', repo_path)
return true if hook.nil?
+
system(hook, ref_name, old_value, new_value)
end