protected function getChangedFiles(IO $io, Repository $repository)
    {
        $oldHash = $io->getArgument('previousHead', 'HEAD@{1}');
        $newHash = $io->getArgument('newHead', 'HEAD');

        return $repository->getDiffOperator()->getChangedFiles($oldHash, $newHash);
    }
protected function getChangedFiles(IO $io, Repository $repository)
    {
        $oldHash = $io->getArgument('previousHead', 'HEAD@{1}');
        $newHash = $io->getArgument('newHead', 'HEAD');

        return $repository->getDiffOperator()->getChangedFiles($oldHash, $newHash);
    }
protected function getChangedFiles ( IO $ io , Repository $ repository ) { $ oldHash = $ io -> getArgument ( 'previousHead' , 'HEAD@{1}' ) ; $ newHash = $ io -> getArgument ( 'newHead' , 'HEAD' ) ; return $ repository -> getDiffOperator ( ) -> getChangedFiles ( $ oldHash , $ newHash ) ; }
Use 'diff-tree' to find the changed files after this merge or checkout

In case of a checkout it is easy because the arguments 'previousHead' and 'newHead' exist.
In case of a merge determining this hashes is more difficult so we are using the 'ref-log'
to do it and using 'HEAD@{1}' as the last position before the merge and 'HEAD' as the
current position after the merge.

@param \CaptainHook\App\Console\IO       $io
@param \SebastianFeldmann\Git\Repository $repository
@return array|string[]
Use diff - tree to find the changed files after this merge or checkout