diff options
| author | Patrick Steinhardt <ps@pks.im> | 2026-02-23 12:59:44 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-23 13:21:18 -0800 |
| commit | 5507200b504f478516bf93767ac3ed3bebed7226 (patch) | |
| tree | cfc4fc69b0ecef670f8be2743837d778983e0cbb /contrib/persistent-https | |
| parent | f503bb7dc96ee92623ade8d60eed401ecfddae0f (diff) | |
| download | git-5507200b504f478516bf93767ac3ed3bebed7226.tar.gz git-5507200b504f478516bf93767ac3ed3bebed7226.zip | |
refs: improve verification for-each-ref options
Improve verification of the passed-in for-each-ref options:
- Require that the `refs` store must be given. It's arguably very
surprising that we simply return successfully in case the ref store
is a `NULL` pointer.
- When expected to trim ref prefixes we will `BUG()` in case the
refname would become empty or in case we're expected to trim a
longer prefix than the refname is long. As such, this case is only
guaranteed to _not_ `BUG()` in case the caller also specified a
prefix. And furthermore, that prefix must end in a trailing slash,
as otherwise it may produce an exact match that could lead us to
trim to the empty string.
An audit shows that there are no callsites that rely on either of these
behaviours, so this should not result in a functional change.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions
