]> git.ipfire.org Git - thirdparty/git.git/commit
refs: return `ref_transaction_error` from `ref_transaction_update()`
authorKarthik Nayak <karthik.188@gmail.com>
Mon, 27 Apr 2026 10:42:05 +0000 (12:42 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Apr 2026 12:35:12 +0000 (21:35 +0900)
commitea088adb59e1bfb5c41093ac8e9dc75ede514b98
tree622776112c12ff209bed066aeca5fc1d01e7011e
parenta5a146c79a6daac852823bb505285a14465bb6d2
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