Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.
What did you do before the bug happened? (Steps to reproduce your issue)
`git checkout -b to-branch; git checkout from-branch -- filenames; git status; git diff`
What did you expect to happen? (Expected behavior)
`git status` expected to show updated files and `git diff` expected to show file changes.
What happened instead? (Actual behavior)
`git status` showed updated files but `git diff` showed no file changes.
What's different between what you expected and what actually happened?
`git diff` was expected to show file changes but it showed nothing instead.
Anything else you want to add:
If I `git reset -q HEAD -- filenames`, `git diff` starts showing file changes.
Please review the rest of the bug report below. You can delete any lines you don't wish to share.
[System Info] git version: git version 2.34.1 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.11.0-36-generic #40~20.04.1-Ubuntu SMP Sat Sep 18 02:14:19 UTC 2021 x86_64 compiler info: gnuc: 9.3 libc info: glibc: 2.31 $SHELL (typically, interactive shell): /bin/bash
[Enabled Hooks] applypatch-msg commit-msg post-applypatch post-checkout post-commit post-merge post-receive post-rewrite post-update pre-applypatch pre-auto-gc pre-commit pre-merge-commit pre-push pre-rebase pre-receive prepare-commit-msg push-to-checkout sendemail-validate update