diff options
-rw-r--r-- | app/services/merge_requests/refresh_service.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb index d3beb2bd260..d26bcce423e 100644 --- a/app/services/merge_requests/refresh_service.rb +++ b/app/services/merge_requests/refresh_service.rb @@ -9,8 +9,8 @@ module MergeRequests Gitlab::GitalyClient.allow_n_plus_1_calls(&method(:find_new_commits)) # Be sure to close outstanding MRs before reloading them to avoid generating an # empty diff during a manual merge - close_merge_requests - fully_merge_manually_merged_merge_requests + close_upon_missing_source_branch_ref + post_merge_manually_merged reload_merge_requests reset_merge_when_pipeline_succeeds mark_pending_todos_done @@ -34,7 +34,7 @@ module MergeRequests # and close if push to master include last commit from merge request # We need this to close(as merged) merge requests that were merged into # target branch manually - def fully_merge_manually_merged_merge_requests + def post_merge_manually_merged commit_ids = @commits.map(&:id) merge_requests = @project.merge_requests.preload(:latest_merge_request_diff).opened.where(target_branch: @branch_name).to_a merge_requests = merge_requests.select(&:diff_head_commit) @@ -51,7 +51,7 @@ module MergeRequests end end - def close_merge_requests + def close_upon_missing_source_branch_ref # MergeRequest#reload_diff ignores not opened MRs. This means it won't # create an `empty` diff for `closed` MRs without a source branch, keeping # the latest diff state as the last _valid_ one. |