]> git.ipfire.org Git - thirdparty/git.git/commit
refs/files-backend: don't peek into `struct lock_file`
authorMartin Ågren <martin.agren@gmail.com>
Tue, 5 Jan 2021 19:23:49 +0000 (20:23 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Jan 2021 21:53:32 +0000 (13:53 -0800)
commit7f0dc7998be01371c99517dc616421239405476c
treef0a60433b2ac50b4be8860490323a7f5f12fa3b5
parentacd7160201ae908d3e0fccee19685ab19b1be720
refs/files-backend: 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. Note how we obtain the path
to the lock file if `fdopen_lock_file()` failed and that this is not a
problem: as documented in lockfile.h, failure to "fdopen" does not roll
back the lock file and we're free to, e.g., query it for its path.

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>
refs/files-backend.c