mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
refs: add function to translate errors to strings
The commit 76e760b999 (refs: introduce enum-based transaction error
types, 2025-04-08) introduced enum-based transaction error types. The
refs transaction logic was also modified to propagate these errors. For
clients of the ref transaction system, it would be beneficial to provide
human readable messages for these errors.
There is already an existing mapping in 'builtin/update-ref.c', move it
to 'refs.c' as `ref_transaction_error_msg()` and use the same within the
'builtin/update-ref.c'.
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
1a8a4971cc
commit
b3de3832ce
5
refs.h
5
refs.h
@@ -907,6 +907,11 @@ void ref_transaction_for_each_rejected_update(struct ref_transaction *transactio
|
||||
ref_transaction_for_each_rejected_update_fn cb,
|
||||
void *cb_data);
|
||||
|
||||
/*
|
||||
* Translate errors to human readable error messages.
|
||||
*/
|
||||
const char *ref_transaction_error_msg(enum ref_transaction_error err);
|
||||
|
||||
/*
|
||||
* Free `*transaction` and all associated data.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user