diff options
| author | Patrick Steinhardt <ps@pks.im> | 2026-02-19 08:57:51 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-02-19 10:41:18 -0800 |
| commit | 9e86e1a05b032d712658bbe70231447455f83fb6 (patch) | |
| tree | 2479334d8cb3e73e4e0184ea00b06f4da2a86cbe /contrib/persistent-https | |
| parent | 7174098834e30d2da1834bbfd0aaf575f6d6bb1a (diff) | |
| download | git-9e86e1a05b032d712658bbe70231447455f83fb6.tar.gz git-9e86e1a05b032d712658bbe70231447455f83fb6.zip | |
bisect: fix misuse of `refs_for_each_ref_in()`
All callers of `refs_for_each_ref_in()` pass in a string that is
terminated with a trailing slash to indicate that they only want to see
refs in that specific ref hierarchy. This is in fact a requirement if
one wants to use this function, as the function trims the prefix from
each yielded ref. So if there was a reference that was called
"refs/bisect" as in our example, the result after trimming would be the
empty string, and that's something we disallow.
Fix this by adding the trailing slash.
Furthermore, taking a closer look, we strip the prefix only to re-add it
in `mark_for_removal()`. This is somewhat roundabout, as we can instead
call `refs_for_each_fullref_in()` to not do any stripping at all. Do so
to simplify the code a bit.
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
