read-cache: try not to peek into `struct {lock_,temp}file`
commit6a8c89d053059b97adb846fce1d22f6d7704c56a
authorMartin Ågren <martin.agren@gmail.com>
Tue, 5 Jan 2021 19:23:50 +0000 (5 20:23 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Jan 2021 21:53:32 +0000 (6 13:53 -0800)
tree23adac2b7b5ceaa22a2105eaef7d5b3472a09085
parent7f0dc7998be01371c99517dc616421239405476c
read-cache: try not to peek into `struct {lock_,temp}file`

Similar to the previous commits, try to avoid peeking into the `struct
lock_file`. We also have some `struct tempfile`s -- let's avoid looking
into those as well.

Note that `do_write_index()` takes a tempfile and that when we call it,
we either have a tempfile which we can easily hand down, or we have a
lock file, from which we need to somehow obtain the internal tempfile.
So we need to leave that one instance of peeking-into. Nevertheless,
this commit leaves us not relying on exactly how the path of the
tempfile / lock file is stored internally.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c