diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-11-24 13:35:07 +0200 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2015-11-30 18:36:34 +0200 |
commit | ae18ba16327abd79cf6207b83209d4ef96d3e158 (patch) | |
tree | 5a1a398cd123428af85c292d988cf04e33c91ce7 /app | |
parent | a8e05cec000f3d2b17b966115c9d7b69629498db (diff) | |
download | gitlab-ce-ae18ba16327abd79cf6207b83209d4ef96d3e158.tar.gz |
Fire update hook from GitLab
Diffstat (limited to 'app')
-rw-r--r-- | app/models/repository.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index c1836103463..d247b0f5012 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -571,9 +571,13 @@ class Repository # Run GitLab pre-receive hook pre_receive_hook = Gitlab::Git::Hook.new('pre-receive', path_to_repo) - status = pre_receive_hook.trigger(gl_id, oldrev, newrev, ref) + pre_receive_hook_status = pre_receive_hook.trigger(gl_id, oldrev, newrev, ref) - if status + # Run GitLab update hook + update_hook = Gitlab::Git::Hook.new('update', path_to_repo) + update_hook_status = update_hook.trigger(gl_id, oldrev, newrev, ref) + + if pre_receive_hook_status && update_hook_status if was_empty # Create branch rugged.references.create(ref, newrev) @@ -596,7 +600,7 @@ class Repository # Remove tmp ref and return error to user rugged.references.delete(tmp_ref) - raise PreReceiveError.new('Commit was rejected by pre-receive hook') + raise PreReceiveError.new('Commit was rejected by git hook') end end |