]> git.ipfire.org Git - thirdparty/git.git/commit
refs/files: skip updates with errors in batched updates
authorKarthik Nayak <karthik.188@gmail.com>
Fri, 20 Jun 2025 07:15:44 +0000 (09:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Jun 2025 15:20:27 +0000 (08:20 -0700)
commit15c45c745872af43df08c60979476520165a1df1
treee4352f32a2a52189aaf6010ad2fa6e0b1da2f638
parent9d2962a7c44fd5f9abec634d05fe28cdafd60036
refs/files: skip updates with errors in batched updates

The commit 23fc8e4f61 (refs: implement batch reference update support,
2025-04-08) introduced support for batched reference updates. This
allows users to batch updates together, while allowing some of the
updates to fail.

Under the hood, batched updates use the reference transaction mechanism.
Each update which fails is marked as such. Any failed updates must be
skipped over in the rest of the code, as they wouldn't apply any more.
In two of the loops within 'files_transaction_finish()' of the files
backend, the failed updates aren't skipped over. This can cause a
SEGFAULT otherwise. Add the missing skips and a test to validate the
same.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c
t/t1400-update-ref.sh