mirror of
https://github.com/git/git.git
synced 2024-12-01 05:54:16 +08:00
refs/files-backend: correct return value in lock_ref_for_update
In one code path we return a literal -1 and not a symbolic constant. The value -1 would be interpreted as TRANSACTION_NAME_CONFLICT, which is wrong. Use TRANSACTION_GENERIC_ERROR instead (that is the only other return value we have to choose from). Noticed-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Martin Ågren <martin.agren@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
851e1fbd01
commit
3f5ef95b5e
@ -2801,7 +2801,7 @@ static int lock_ref_for_update(struct files_ref_store *refs,
|
||||
strbuf_addf(err, "cannot lock ref '%s': "
|
||||
"error reading reference",
|
||||
original_update_refname(update));
|
||||
ret = -1;
|
||||
ret = TRANSACTION_GENERIC_ERROR;
|
||||
goto out;
|
||||
}
|
||||
} else if (check_old_oid(update, &lock->old_oid, err)) {
|
||||
|
Loading…
Reference in New Issue
Block a user