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 CommandRunner abstraction to StandardGitCommand, eliminating global state coupling
  • Adds GitRunner() to the Factory interface, wired through Factory.Executor()
  • Rewrites mr checkout tests using mock GitRunner via cmdtest framework
  • Adds test coverage for --set-upstream-to codepath

Addresses #8275 (closed), #8276 (closed)

Edited by Gary Holtz

Merge request reports

Loading