]> git.ipfire.org Git - thirdparty/git.git/commit
refs: add function to translate errors to strings
authorKarthik Nayak <karthik.188@gmail.com>
Mon, 19 May 2025 09:58:06 +0000 (11:58 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 May 2025 18:06:31 +0000 (11:06 -0700)
commitb3de3832ce7497d6567d2d8270c829585b9fbf61
treebdf04d940d9d9236a3d70e447a97a9a21c6f85db
parent1a8a4971cc6c179c4dd711f4a7f5d7178f4b3ab7
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>
builtin/update-ref.c
refs.c
refs.h