refactor(git): decouple StandardGitCommand from run.PrepareCmd
Summary
Decouples StandardGitCommand from the global run.PrepareCmd by introducing a CommandRunner function type, and wires it through Factory.GitRunner() via the existing Executor pattern. This enables mr checkout tests to use a mock GitRunner instead of shelling out to real git.
- Adds
CommandRunnerabstraction toStandardGitCommand, eliminating global state coupling - Adds
GitRunner()to theFactoryinterface, wired throughFactory.Executor() - Rewrites
mr checkouttests using mockGitRunnerviacmdtestframework - Adds test coverage for
--set-upstream-tocodepath
Addresses #8275 (closed), #8276 (closed)
Edited by Gary Holtz