t4111 (apply): refresh index before applying patches to it
authorJonathan Nieder <jrnieder@gmail.com>
Fri, 30 Jul 2010 18:31:22 +0000 (13:31 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Aug 2010 18:21:14 +0000 (11:21 -0700)
"git apply", like most plumbing, does not automatically refresh the
index file even if it is only stat-dirty. So unless the two "cp"
commands in reset_preimage() for a given file happen to have the same
time stamp, there will be a spurious

error: sub/dir/file: does not match index

Refresh the index to eliminate this timing dependency. Noticed by
running the test with --valgrind (which slows things down a lot).

Reported-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found