diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-02-02 00:17:30 +0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-02-02 00:18:07 +0300 |
commit | 178816068c2dc1ca62487e0b4caa075d5a709d08 (patch) | |
tree | abe2f108e86ded59068960490b012223a66b176b /app/services/merge_requests | |
parent | 5b73e0eb35f5b9b78c228a4867ef78538ef05653 (diff) |
Reload MRs memoization after diffs creation
Diffstat (limited to 'app/services/merge_requests')
-rw-r--r-- | app/services/merge_requests/refresh_service.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb index 262622f8bd0..18c40ce8992 100644 --- a/app/services/merge_requests/refresh_service.rb +++ b/app/services/merge_requests/refresh_service.rb @@ -90,6 +90,10 @@ module MergeRequests merge_request.mark_as_unchecked UpdateHeadPipelineForMergeRequestWorker.perform_async(merge_request.id) end + + # Upcoming method calls need the refreshed version of + # @source_merge_requests diffs (for MergeRequest#commit_shas for instance). + merge_requests_for_source_branch(reload: true) end def reset_merge_when_pipeline_succeeds @@ -195,7 +199,8 @@ module MergeRequests merge_requests.uniq.select(&:source_project) end - def merge_requests_for_source_branch + def merge_requests_for_source_branch(reload: false) + @source_merge_requests = nil if reload @source_merge_requests ||= merge_requests_for(@branch_name) end |