read-cache.c: move tempfile creation/cleanup out of write_shared_index
commit59f9d2dd60f97c55c92c3273903f64048a27e513
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 14 Jan 2018 10:18:19 +0000 (14 17:18 +0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Jan 2018 21:12:07 +0000 (16 13:12 -0800)
tree091d123595e4d233083f892ab5c20f85c2705cbb
parent7db2d08cdccc39ea3d9a1da2da30e54f92b8fd12
read-cache.c: move tempfile creation/cleanup out of write_shared_index

For one thing, we have more consistent cleanup procedure now and always
keep errno intact.

The real purpose is the ability to break out of write_locked_index()
early when mks_tempfile() fails in the next patch. It's more awkward to
do it if this mks_tempfile() is still inside write_shared_index().

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c