read-cache: close index.lock in do_write_index
commit9f41c7a6b3e3cc3ac4a739364400393fa2492880
authorJeff Hostetler <jeffhost@microsoft.com>
Wed, 26 Apr 2017 20:05:23 +0000 (26 22:05 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 Apr 2017 03:40:24 +0000 (28 12:40 +0900)
tree38753a8a56b7bc5e6a2a856780a9430f025f74e0
parent49800c940790cc7465d1b03e08d472ffd8684808
read-cache: close index.lock in do_write_index

Teach do_write_index() to close the index.lock file
before getting the mtime and updating the istate.timestamp
fields.

On Windows, a file's mtime is not updated until the file is
closed.  On Linux, the mtime is set after the last flush.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c