diff options
author | Mark Chao <mchao@gitlab.com> | 2018-12-07 17:58:39 +0800 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2018-12-07 21:00:47 +0800 |
commit | 2f7563a6746519516c1464ac2a74b7e3c0eca63f (patch) | |
tree | ed057c8bdc47af8aec18a1addc0624df3c3e26c5 /app | |
parent | c6c53d1c7418b2c83410a21bce068a6dfd7858b0 (diff) | |
download | gitlab-ce-2f7563a6746519516c1464ac2a74b7e3c0eca63f.tar.gz |
Guard with feature flag
Diffstat (limited to 'app')
-rw-r--r-- | app/services/merge_requests/refresh_service.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb index 91de910796b..f712b8863cd 100644 --- a/app/services/merge_requests/refresh_service.rb +++ b/app/services/merge_requests/refresh_service.rb @@ -66,13 +66,18 @@ module MergeRequests return if merge_requests.empty? - analyzer = Gitlab::BranchPushMergeCommitAnalyzer.new( - @commits.reverse, - relevant_commit_ids: merge_requests.map(&:diff_head_sha) - ) + commit_analyze_enabled = Feature.enabled?(:branch_push_merge_commit_analyze, @project, default_enabled: true) + if commit_analyze_enabled + analyzer = Gitlab::BranchPushMergeCommitAnalyzer.new( + @commits.reverse, + relevant_commit_ids: merge_requests.map(&:diff_head_sha) + ) + end merge_requests.each do |merge_request| - merge_request.merge_commit_sha = analyzer.get_merge_commit(merge_request.diff_head_sha) + if commit_analyze_enabled + merge_request.merge_commit_sha = analyzer.get_merge_commit(merge_request.diff_head_sha) + end MergeRequests::PostMergeService .new(merge_request.target_project, @current_user) |