Re: 'git status' is not read-only fs friendly
- From
Junio C Hamano <junkio@cox.net>
- Date
- Feb 9, 2007, 20:27 UTC
- Message-ID
- <7vk5yrt6t0.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <e5bfff550702091219n4df5531ek6be2cd04f00be650@mail.gmail.com>
"Marco Costalba" <mcostalba@gmail.com> writes:
> Sorry, perhaps it is a silly question, but why git index should be > different after just touching a file?
It uses the information from lstat(2) that is stored in the index and taken from the filesystem -- if they are different (touch changes it as you know, but so does "vi that-file") they are reported as "modified".
git checkout -- Makefile
git diff-files Makefile
touch Makefile
git diff-files MakefileThe 'refresh' operation is to update the lstat(2) information in the index for paths whose contents actually match what is in the index (and it does not do anything else -- most notably paths whose contents are different between the working tree and the index are left as-is).