diff options
author | Stan Hu <stanhu@gmail.com> | 2015-12-01 00:31:42 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-12-01 00:31:42 -0800 |
commit | 9b10701258d2aadbc1392c1cd7072584c8642ada (patch) | |
tree | d6024adb8b4fa06d369266ac627f66a4f7a82e66 /app | |
parent | a518879a6fe606630b225ccfc4f489b3b0d58adf (diff) | |
parent | 13c6096e42e5b20039f78b9415bea82e1f2507eb (diff) | |
download | gitlab-ce-9b10701258d2aadbc1392c1cd7072584c8642ada.tar.gz |
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
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 |