diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-02-02 17:18:31 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-02-02 17:18:31 +0000 |
commit | e685acbaf5f83ee5c78455784145300abe5dd381 (patch) | |
tree | 1c5231e68e5bee722d013947081fe64c21b2bc8a /app/services | |
parent | 283ace44dd156a5698a3191e2901c3302c1ad52f (diff) | |
parent | 4b143e720b3830ad11df04b9bc3c722bf990b11c (diff) | |
download | gitlab-ce-e685acbaf5f83ee5c78455784145300abe5dd381.tar.gz |
Merge branch 'osw-system-notes-for-commits-regression' into 'master'
Reload source MRs memoization after diffs creation
Closes #42668
See merge request gitlab-org/gitlab-ce!16868
Diffstat (limited to 'app/services')
-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 |