summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2019-08-22 10:38:12 +0000
committerJan Provaznik <jprovaznik@gitlab.com>2019-08-22 10:38:12 +0000
commitde7328b1e1e38a2534857d929f3f0b2c5a48897c (patch)
treef58093028e0e9dc9584ac34475cd5b8fae92c247
parent34bf7df0ffd4c872b631f67fd9337930a9e40683 (diff)
parent0e274dfca07ced0458db69b4dfc86a57c39620e5 (diff)
downloadgitlab-ce-de7328b1e1e38a2534857d929f3f0b2c5a48897c.tar.gz
Merge branch '66368-remove-unnecessary-check-in-mr-hook' into 'master'
Remove unneeded check for merge_request.project Closes #66368 See merge request gitlab-org/gitlab-ce!32086
-rw-r--r--app/services/merge_requests/base_service.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/services/merge_requests/base_service.rb b/app/services/merge_requests/base_service.rb
index 067510a8a0a..c6aae4c28f2 100644
--- a/app/services/merge_requests/base_service.rb
+++ b/app/services/merge_requests/base_service.rb
@@ -17,11 +17,9 @@ module MergeRequests
end
def execute_hooks(merge_request, action = 'open', old_rev: nil, old_associations: {})
- if merge_request.project
- merge_data = hook_data(merge_request, action, old_rev: old_rev, old_associations: old_associations)
- merge_request.project.execute_hooks(merge_data, :merge_request_hooks)
- merge_request.project.execute_services(merge_data, :merge_request_hooks)
- end
+ merge_data = hook_data(merge_request, action, old_rev: old_rev, old_associations: old_associations)
+ merge_request.project.execute_hooks(merge_data, :merge_request_hooks)
+ merge_request.project.execute_services(merge_data, :merge_request_hooks)
end
def cleanup_environments(merge_request)