When --git-base is used, we use git diff $BASE... to fetch the diff,
which will diff against the merge-base of $BASE and HEAD rather than
against $BASE itself.
When we run phpcs for the old file versions, we run it against the
version from $BASE itself rather than the merge-base version.
Since the diff does not match the versions of the files used to produce
the phpcs output, the line number correction may fail and unchanged
issues may be incorrectly reported.
This PR adds an initial step that replaces the passed --git-base with
the merge-base commit hash so later steps use the correct file versions.
When
--git-base
is used, we usegit diff $BASE...
to fetch the diff, which will diff against the merge-base of $BASE and HEAD rather than against $BASE itself.When we run phpcs for the old file versions, we run it against the version from $BASE itself rather than the merge-base version.
Since the diff does not match the versions of the files used to produce the phpcs output, the line number correction may fail and unchanged issues may be incorrectly reported.
This PR adds an initial step that replaces the passed --git-base with the merge-base commit hash so later steps use the correct file versions.
Fixes #42