reftable/error: discern locked/outdated errors
commitaf18098c9d2b2e165aca127c35eeb98d157bd542
authorPatrick Steinhardt <ps@pks.im>
Mon, 25 Mar 2024 10:02:42 +0000 (25 11:02 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Mar 2024 16:51:11 +0000 (25 09:51 -0700)
treeb8afafa5d24c559cb4b0c378f59e19abd3da9ddd
parent630942a873ae0f1d067efaaf7b4d1b05cfb3a141
reftable/error: discern locked/outdated errors

We currently throw two different errors into a similar-but-different
error code:

  - Errors when trying to lock the reftable stack.

  - Errors when trying to write to the reftable stack which has been
    modified concurrently.

This results in unclear error handling and user-visible error messages.

Create a new `REFTABLE_OUTDATED_ERROR` so that those error conditions
can be clearly told apart from each other. Adjust users of the old
`REFTABLE_LOCK_ERROR` to use the new error code as required.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/error.c
reftable/reftable-error.h
reftable/stack.c
reftable/stack_test.c