git mv: try harder to keep index entries intact
commit8a5ab10a4a510a63b0579164648ce4c732e4f9bf
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 1 Aug 2008 16:25:31 +0000 (1 18:25 +0200)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Sun, 7 Feb 2010 19:19:25 +0000 (7 20:19 +0100)
tree806e3e15a72888aaeeca4dadb37b354eb0113e83
parentf68f5667264f01480992367876b9899eaf2325d1
git mv: try harder to keep index entries intact

Some filesystems change the ctime during a rename(), for technical
reasons.  Since this is the only change, the contents need not be
rehashed.  So just update the ctime after renaming the entry.

This change requires rename_index_entry_at() to return the new position.

To test this properly, you need to run t7001 with the environment variable
TEST_CTIME_WITH_SLEEP set non-empty, since there is no way to manipulate
the ctime directly; we have to sleep.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
builtin-mv.c
cache.h
read-cache.c
t/t7001-mv.sh