]> git.ipfire.org Git - thirdparty/git.git/commit
refs: return `ref_transaction_error` from `ref_transaction_update()`
authorKarthik Nayak <karthik.188@gmail.com>
Mon, 4 May 2026 17:44:08 +0000 (19:44 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 May 2026 07:34:07 +0000 (16:34 +0900)
commite99e98e600181ddf431b267c2887358b3556e45c
tree622776112c12ff209bed066aeca5fc1d01e7011e
parentcc42c88945753363d67d130c79640e3c682e1334
refs: return `ref_transaction_error` from `ref_transaction_update()`

The `ref_transaction_update()` function is used to add updates to a
given reference transactions. In the following commit, we'll add more
validation to this function. As such, it would be beneficial if the
function returns specific error types, so callers can differentiate
between different errors.

To facilitate this, return `enum ref_transaction_error` from the
function and covert the existing '-1' returns to
'REF_TRANSACTION_ERROR_GENERIC'. Since this retains the existing
behavior, no changes are made to any of the callers but this sets the
necessary infrastructure for introduction of other errors.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
refs.h