Skip to content

Replace different_project? method with instance variable

Anatoli Babenia requested to merge gitlab-community/gitlab:minor-commit into master

What does this MR do and why?

While reading the code to solve #424579 I found that different_project? method can only be called after create_commit method, which sets necessary instance variables being checked. The MR removes that level of indirection by letting create_commit set @different_project field explicitly.

This will also help to replace concern with composition in future (#16270), where create_commit could return an error object with all necessary fields to render, instead of injecting the fields into including class.

How to set up and validate locally

#424579

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Anatoli Babenia

Merge request reports