]> git.ipfire.org Git - thirdparty/git.git/commit
refs: skip to next ref when current ref is rejected
authorKarthik Nayak <karthik.188@gmail.com>
Fri, 16 Jan 2026 21:27:07 +0000 (22:27 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Jan 2026 22:06:44 +0000 (14:06 -0800)
commit3f5f409159db7d3246452dbe2bbb5bc2c436ea00
tree7809011000f783547c37532c509ff76bca9b33a1
parent5971ea236877d237d8807008441e8d6569d0d487
refs: skip to next ref when current ref is rejected

In `refs_verify_refnames_available()` we have two nested loops: the
outer loop iterates over all references to check, while the inner loop
checks for filesystem conflicts for a given ref by breaking down its
path.

With batched updates, when we detect a filesystem conflict, we mark the
update as rejected and execute 'continue'. However, this only skips to
the next iteration of the inner loop, not the outer loop as intended.
This causes the same reference to be repeatedly rejected. Fix this by
using a goto statement to skip to the next reference in the outer loop.

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