Problem/Motivation
In #3401971: Test-only job shouldn't require constant rebases to detect which files were changed. we tried to fix a test-only job to not require constant rebases. It seems like it is working for most use-cases, but there are some where it is not:
Here #3277003-23: Harden user_pass_rehash() against attack we triggered test-only pipeline on non-rebased MR, but it still reverted other unrelated changes, see: https://git.drupalcode.org/project/drupal/-/jobs/506479
Steps to reproduce
See MR: https://git.drupalcode.org/project/drupal/-/merge_requests/5823
and job: https://git.drupalcode.org/project/drupal/-/jobs/506479
Proposed resolution
Update the git diff logic to cover also this use-case.