Fix resolving conflicts on forks
What does this MR do?
When we resolve conflicts, we create a merge commit in the source branch with parents
[source_branch_head, target_branch_head]. But when the MR is from a fork,
target_branch_head might not exist in the source repo at all, so we need to fetch it if it isn't there. We can do this locally so it should be fast.
Are there points in the code the reviewer needs to double check?
TestEnv changes are needed to reset the branch refs if we're reusing a git directory locally - otherwise, there might not be conflicts!
Why was this MR needed?
It's a bug in a new feature!
Does this MR meet the acceptance criteria?
- CHANGELOG entry added
- Added for this feature/bug
- All builds are passing
- Conform by the style guides
Branch has no merge conflicts with
master(if you do - rebase it please)
- Squashed related commits together
What are the relevant issue numbers?
Closes #21459 (closed).