From 05f4e48a4c761e13faf080e2d33fb8cc9886f723 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Thu, 26 Jan 2017 19:35:19 +0800 Subject: Make GitHooksService#execute return block value Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_21627207 --- app/services/git_hooks_service.rb | 6 +++--- app/services/git_operation_service.rb | 6 +----- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'app/services') 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) -- cgit v1.2.1