diff options
| author | Douwe Maan <douwe@gitlab.com> | 2015-04-06 12:41:38 +0200 |
|---|---|---|
| committer | Douwe Maan <douwe@gitlab.com> | 2015-04-06 13:10:10 +0200 |
| commit | e8403e8bb7c5c9109af83a183943d5361ad1409b (patch) | |
| tree | 0fe3e73b6695816c3ce0a8f01f9fb8cac29a1a9f /lib | |
| parent | f64e5d4a075479846f2e18bb34b84eb26d180f57 (diff) | |
| download | gitlab-shell-e8403e8bb7c5c9109af83a183943d5361ad1409b.tar.gz | |
Move setting/unsetting of GL_ID from lib to executables.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gitlab_custom_hook.rb | 13 | ||||
| -rw-r--r-- | lib/gitlab_post_receive.rb | 4 |
2 files changed, 5 insertions, 12 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 diff --git a/lib/gitlab_post_receive.rb b/lib/gitlab_post_receive.rb index 3c601ee..ede64f2 100644 --- a/lib/gitlab_post_receive.rb +++ b/lib/gitlab_post_receive.rb @@ -13,10 +13,6 @@ class GitlabPostReceive end def exec - # reset GL_ID env since we already - # get value from it - ENV['GL_ID'] = nil - result = update_redis begin |
