From: Junio C Hamano Date: Thu, 05 Nov 2026 23:03:07 GMT Subject: Re: [PATCH v2 01/12] remote: validate --force-with-lease argument Message-ID: In-Reply-To: <20261014031347.50433-2-jon@jonsimons.org> Jon Simons writes: > Use check_refname_format() to validate the component of > 'git push --force-with-lease=[:]'. > > apply_push_cas() will silently ignore a lease entry that does not match > any remote ref. And today "./refs/heads/main" will happen to be matched > with "refs/heads/main" due to refname_match() usage of mkpath(), whose > cleanup_path() strips leading "./". Technically this may be a regression, but hopefully nobody would be insane enough to have used such a refname. > An upcoming commit removes mkpath() from refname_match(), after which > there is no unintentional match in this situation, so that the lease > is ignored instead of applied. Reject an invalid refname now to make > this situation fail fast both before and after that change. In other words, we would be introducing the same (technical) regression, so breaking this calling site is not a huge issue ;-)