diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-03-02 11:03:48 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-03-02 11:12:16 -0800 |
| commit | 4c9355ff48a33eb60a4f2a51f08939320cf3f2d3 (patch) | |
| tree | d5c6eb4f5a3e36f14120e150520e78033a00ee4c /t/unit-tests/t-strbuf.c | |
| parent | 36ffba1c7be8d831065adab73a7a215f402ef432 (diff) | |
repack: check error writing to pack-objects subprocess
When "git repack" repacks promisor objects, it starts a pack-objects
subprocess and uses xwrite() to send object names over the pipe to
it, but without any error checking. An I/O error or short write
(even though a short write is unlikely for such a small amount of
data) can result in a packfile that lacks certain objects we wanted
to put in there, leading to a silent repository corruption.
Use write_in_full(), instead of xwrite(), to mitigate short write
risks, check errors from it, and abort if we see a failure.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests/t-strbuf.c')
0 files changed, 0 insertions, 0 deletions
