ref-filter: properly distinuish pseudo and root refs

The ref-filter interfaces currently define root refs as either a
detached HEAD or a pseudo ref. Pseudo refs aren't root refs though, so
let's properly distinguish those ref types.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2024-05-15 08:51:05 +02:00
committed by Junio C Hamano
parent 993d57eded
commit f1701f279a
5 changed files with 31 additions and 27 deletions

View File

@ -98,7 +98,7 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
}
if (include_root_refs)
flags |= FILTER_REFS_ROOT_REFS;
flags |= FILTER_REFS_ROOT_REFS | FILTER_REFS_DETACHED_HEAD;
filter.match_as_path = 1;
filter_and_format_refs(&filter, flags, sorting, &format);