refs: add TRANSACTION_CREATE_EXISTS error
Currently there is only one special error for transaction, for when there is a naming conflict, all other errors are dumped under a generic error. Add a new special error case for when the caller requests the reference to be updated only when it does not yet exist and the reference actually does exist. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
dfe86fa06b
commit
ed2f6f8804
4
refs.h
4
refs.h
@ -773,8 +773,10 @@ int ref_transaction_verify(struct ref_transaction *transaction,
|
||||
|
||||
/* Naming conflict (for example, the ref names A and A/B conflict). */
|
||||
#define TRANSACTION_NAME_CONFLICT -1
|
||||
/* When only creation was requested, but the ref already exists. */
|
||||
#define TRANSACTION_CREATE_EXISTS -2
|
||||
/* All other errors. */
|
||||
#define TRANSACTION_GENERIC_ERROR -2
|
||||
#define TRANSACTION_GENERIC_ERROR -3
|
||||
|
||||
/*
|
||||
* Perform the preparatory stages of committing `transaction`. Acquire
|
||||
|
Reference in New Issue
Block a user