From af18098c9d2b2e165aca127c35eeb98d157bd542 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Mon, 25 Mar 2024 11:02:42 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- reftable/stack_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'reftable/stack_test.c') diff --git a/reftable/stack_test.c b/reftable/stack_test.c index 509f486623..b0c7041a4f 100644 --- a/reftable/stack_test.c +++ b/reftable/stack_test.c @@ -232,7 +232,7 @@ static void test_reftable_stack_uptodate(void) EXPECT_ERR(err); err = reftable_stack_add(st2, &write_test_ref, &ref2); - EXPECT(err == REFTABLE_LOCK_ERROR); + EXPECT(err == REFTABLE_OUTDATED_ERROR); err = reftable_stack_reload(st2); EXPECT_ERR(err); -- cgit 1.2.3-korg