Git diff on a merge request

Hi all,
I am using the below command in my CI pipeline to determine the list of files changed as part of the given commit id.
git diff-tree --no-commit-id --name-only -r 243cb97da650f71b991b2d9927a3d66e94400e30
This works fine when we do a git push to the branch.
But when we complete a merge request from another branch to the same branch, a new commit id is generated and when I submit the same query, it does not give any results.
git diff-tree --no-commit-id --name-only -r newcommitid
But if I go to Gitlab UI in the same branch, when I select the new commit id, I can see the changed files. How is the git lab UI works in this specific case? Whats the alternate git command I can use to list the changed files?