]> git.ipfire.org Git - thirdparty/git.git/commit - midx.c
midx: don't peek into `struct lock_file`
authorMartin Ågren <martin.agren@gmail.com>
Tue, 5 Jan 2021 19:23:48 +0000 (20:23 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Jan 2021 21:53:32 +0000 (13:53 -0800)
commitacd7160201ae908d3e0fccee19685ab19b1be720
tree0ba4fe142d46ac09fe66dabbb0f914f450b857da
parenta52cdce936fe473429bd4354079f03c3fb0234e9
midx: don't peek into `struct lock_file`

Similar to the previous commits, avoid peeking into the `struct
lock_file`. Use the lock file API instead.

The two functions we're calling here double-check that the tempfile is
indeed "active", which is arguably overkill considering how we took the
lock on the line immediately above. More importantly, this future-proofs
us against, e.g., other code appearing between these two lines or the
lock file and/or tempfile internals changing.

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>
midx.c