Commit 05f4e48a authored by Lin Jen-Shin's avatar Lin Jen-Shin

Make GitHooksService#execute return block value

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_21627207
parent 9bb4cd75
...@@ -18,9 +18,9 @@ class GitHooksService ...@@ -18,9 +18,9 @@ class GitHooksService
end end
end end
yield self yield(self).tap do
run_hook('post-receive')
run_hook('post-receive') end
end end
private private
......
...@@ -107,8 +107,6 @@ class GitOperationService ...@@ -107,8 +107,6 @@ class GitOperationService
end end
def with_hooks(ref, newrev, oldrev) def with_hooks(ref, newrev, oldrev)
result = nil
GitHooksService.new.execute( GitHooksService.new.execute(
user, user,
repository.path_to_repo, repository.path_to_repo,
...@@ -116,10 +114,8 @@ class GitOperationService ...@@ -116,10 +114,8 @@ class GitOperationService
newrev, newrev,
ref) do |service| ref) do |service|
result = yield(service) if block_given? yield(service)
end end
result
end end
def update_ref(ref, newrev, oldrev) def update_ref(ref, newrev, oldrev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment