diff options
author | Taylor Blau <me@ttaylorr.com> | 2024-06-06 18:19:31 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-06-07 08:40:50 -0700 |
commit | 8981dca8bc717d7656f28fc375b513b91b365360 (patch) | |
tree | 1f5bb6c956d2f56fad88c02f745118055869a15b /commit-graph.c | |
parent | c195ecda7703098f28c160cc63306ca0e1488236 (diff) |
server-info.c: remove temporary info files on exit
The update_info_file() function within server-info.c is responsible for
moving the info/refs and info/packs files around when updating server
info.
These updates are staged into a temporary file and then moved into place
atomically to avoid race conditions when reading those files. However,
the temporary file used to stage these changes is managed outside of the
tempfile.h API, and thus survives process death.
Manage these files instead with the tempfile.h API so that they are
automatically cleaned up upon abnormal process death.
Unfortunately, and unlike in the previous step, there isn't a
straightforward way to inject a failure into the update-server-info step
that causes us to die() rather than take the cleanup path in label
'out', hence the lack of a test here.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions