diff options
| author | Derrick Stolee <stolee@gmail.com> | 2025-09-05 19:26:18 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-09-05 12:32:01 -0700 |
| commit | c25651aefdf583ebb2dbb88437337947372de8f3 (patch) | |
| tree | 8c50f592383a41531fd6ead5b51aa5d2097cc51c /upload-pack.c | |
| parent | 1f2bc6be1dbbda5bc40a23bd58a60bbee9de7401 (diff) | |
midx-write: simplify error cases
The write_midx_internal() method uses gotos to jump to a cleanup section to
clear memory before returning 'result'. Since these jumps are more common
for error conditions, initialize 'result' to -1 and then only set it to 0
before returning with success. There are a couple places where we return
with success via a jump.
This has the added benefit that the method now returns -1 on error instead
of an inconsistent 1 or -1.
Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'upload-pack.c')
0 files changed, 0 insertions, 0 deletions
