]> git.ipfire.org Git - thirdparty/git.git/commit
refs/files: remove duplicate duplicates check
authorKarthik Nayak <karthik.188@gmail.com>
Tue, 8 Apr 2025 08:51:07 +0000 (10:51 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Apr 2025 14:57:19 +0000 (07:57 -0700)
commit4dfcf18089be03d70dd4a0437bb40af156062738
tree9ddfaaf3f2f64bb9808bfcd54f73582352395070
parentc3baddf04f8fb20bec590f492f00189fd6c02a35
refs/files: remove duplicate duplicates check

Within the files reference backend's transaction's 'finish' phase, a
verification step is currently performed wherein the refnames list is
sorted and examined for multiple updates targeting the same refname.

It has been observed that this verification is redundant, as an
identical check is already executed during the transaction's 'prepare'
stage. Since the refnames list remains unmodified following the
'prepare' stage, this secondary verification can be safely eliminated.

The duplicate check has been removed accordingly, and the
`ref_update_reject_duplicates()` function has been marked as static, as
its usage is now confined to 'refs.c'.

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/files-backend.c
refs/refs-internal.h