aboutsummaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2025-05-19 11:58:06 +0200
committerJunio C Hamano <gitster@pobox.com>2025-05-19 11:06:31 -0700
commitb3de3832ce7497d6567d2d8270c829585b9fbf61 (patch)
treebdf04d940d9d9236a3d70e447a97a9a21c6f85db /refs.h
parent1a8a4971cc6c179c4dd711f4a7f5d7178f4b3ab7 (diff)
downloadgit-b3de3832ce7497d6567d2d8270c829585b9fbf61.tar.xz
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>
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index 46a6008e07..2d58af3d88 100644
--- a/refs.h
+++ b/refs.h
@@ -908,6 +908,11 @@ void ref_transaction_for_each_rejected_update(struct ref_transaction *transactio
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.
*/
void ref_transaction_free(struct ref_transaction *transaction);