From: Jon Simons Date: Fri, 09 Oct 2026 19:29:39 GMT Subject: [PATCH 01/15] remote: validate --force-with-lease argument Message-ID: <20261009192953.81794-2-jon@jonsimons.org> In-Reply-To: <20261009192953.81794-1-jon@jonsimons.org> 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 "./". 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. Signed-off-by: Jon Simons --- remote.c | 2 ++ t/t5533-push-cas.sh | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/remote.c b/remote.c index 71170f36a9..114d4d983c 100644 --- a/remote.c +++ b/remote.c @@ -2740,6 +2740,8 @@ static int parse_push_cas_option(struct push_cas_option *cas, const char *arg, i /* "--