diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-01-26 19:35:19 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-01-26 19:35:19 +0800 |
commit | 05f4e48a4c761e13faf080e2d33fb8cc9886f723 (patch) | |
tree | e2a5e6ec86322294efc0f025aef824d85db89938 /app/services | |
parent | 9bb4cd75ad51f61a53a2bef205be2b4b24acc513 (diff) | |
download | gitlab-ce-05f4e48a4c761e13faf080e2d33fb8cc9886f723.tar.gz |
Make GitHooksService#execute return block value
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_21627207
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/git_hooks_service.rb | 6 | ||||
-rw-r--r-- | app/services/git_operation_service.rb | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/app/services/git_hooks_service.rb b/app/services/git_hooks_service.rb index 6cd3908d43a..d222d1e63aa 100644 --- a/app/services/git_hooks_service.rb +++ b/app/services/git_hooks_service.rb @@ -18,9 +18,9 @@ class GitHooksService end end - yield self - - run_hook('post-receive') + yield(self).tap do + run_hook('post-receive') + end end private diff --git a/app/services/git_operation_service.rb b/app/services/git_operation_service.rb index 2b2ba0870a4..df9c393844d 100644 --- a/app/services/git_operation_service.rb +++ b/app/services/git_operation_service.rb @@ -107,8 +107,6 @@ class GitOperationService end def with_hooks(ref, newrev, oldrev) - result = nil - GitHooksService.new.execute( user, repository.path_to_repo, @@ -116,10 +114,8 @@ class GitOperationService newrev, ref) do |service| - result = yield(service) if block_given? + yield(service) end - - result end def update_ref(ref, newrev, oldrev) |