Replace different_project? method with instance variable
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
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Anatoli Babenia