Re: Bug Report: git ls-files -d
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 27, 2021, 21:21 UTC
- Message-ID
- <xmqqtui5ogt3.fsf@gitster.g>
- In-Reply-To
- <CAP9BFHVdg_BWZ2wvdv8t-mN3WKjW4fA+v2181WRYQGsrgmvKmA@mail.gmail.com>
What did you expect to happen? (Expected behavior)
git ls-files -d to show deleted files in my repository What happened instead? (Actual behavior)
nothing is shownDoes not reproduce to me.
$ git reset --hard
$ git ls-files -s COPYING
100644 536e55524db72bd2acf175208aef4f3dfc148d42 0 COPYING
$ ls -1 COPYING
COPYING
$ git ls-files -d; echo no output
no output
$ rm COPYING
$ git ls-files -d
COPYINGDid you remove any file? "ls-files -d" reports the working tree files that have been removed that are still known by the index. So, after all of the above
$ git rm --cached COPYING
$ git ls-files -d; echo no output
no outputis perfectly expected.
Unlike "git ls-files" that checks the working files against what is in the index, "git status" checks them against both the index and the HEAD, so after all of the above, it would notice the removal relative to HEAD:
$ git status -uno --porcelain
D COPYINGHTH.