]> git.ipfire.org Git - thirdparty/git.git/commit
refs: support rejection in batch updates during F/D checks
authorKarthik Nayak <karthik.188@gmail.com>
Tue, 8 Apr 2025 08:51:11 +0000 (10:51 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Apr 2025 14:57:21 +0000 (07:57 -0700)
commit31726bb90d70236f7afaa345bf45195e2ef62d22
treedc023d15f3b1de5d8036a6f043a911c435fd18af
parent23fc8e4f613179900ce28da959757a387543b468
refs: support rejection in batch updates during F/D checks

The `refs_verify_refnames_available()` is used to batch check refnames
for F/D conflicts. While this is the more performant alternative than
its individual version, it does not provide rejection capabilities on a
single update level. For batched updates, this would mean a rejection of
the entire transaction whenever one reference has a F/D conflict.

Modify the function to call `ref_transaction_maybe_set_rejected()` to
check if a single update can be rejected. Since this function is only
internally used within 'refs/' and we want to pass in a `struct
ref_transaction *` as a variable. We also move and mark
`refs_verify_refnames_available()` to 'refs-internal.h' to be an
internal function.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
refs.h
refs/files-backend.c
refs/refs-internal.h
refs/reftable-backend.c