reftable/stack: refactor reloading to use file descriptor
commitc5b5d5fbbc43364a3d3c0aedf9e984a0ffe04537
authorPatrick Steinhardt <ps@pks.im>
Thu, 11 Jan 2024 10:06:43 +0000 (11 11:06 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Jan 2024 20:10:59 +0000 (11 12:10 -0800)
treea55aaae4e5ab4f463b6ca3c95f4fbc1a7248f0dd
parent3c94bd8dfb43d1e6f38184e34f4d5a0046dd00d7
reftable/stack: refactor reloading to use file descriptor

We're about to introduce a stat(3P)-based caching mechanism to reload
the list of stacks only when it has changed. In order to avoid race
conditions this requires us to have a file descriptor available that we
can use to call fstat(3P) on.

Prepare for this by converting the code to use `fd_read_lines()` so that
we have the file descriptor readily available.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/stack.c