Merge branch 'kn/for-all-refs'
"git for-each-ref" learned "--include-root-refs" option to show even the stuff outside the 'refs/' hierarchy. * kn/for-all-refs: for-each-ref: add new option to include root refs ref-filter: rename 'FILTER_REFS_ALL' to 'FILTER_REFS_REGULAR' refs: introduce `refs_for_each_include_root_refs()` refs: extract out `loose_fill_ref_dir_regular_file()` refs: introduce `is_pseudoref()` and `is_headref()`
This commit is contained in:
@ -364,12 +364,15 @@ static int reftable_ref_iterator_advance(struct ref_iterator *ref_iterator)
|
||||
break;
|
||||
|
||||
/*
|
||||
* The files backend only lists references contained in
|
||||
* "refs/". We emulate the same behaviour here and thus skip
|
||||
* all references that don't start with this prefix.
|
||||
* The files backend only lists references contained in "refs/" unless
|
||||
* the root refs are to be included. We emulate the same behaviour here.
|
||||
*/
|
||||
if (!starts_with(iter->ref.refname, "refs/"))
|
||||
if (!starts_with(iter->ref.refname, "refs/") &&
|
||||
!(iter->flags & DO_FOR_EACH_INCLUDE_ROOT_REFS &&
|
||||
(is_pseudoref(&iter->refs->base, iter->ref.refname) ||
|
||||
is_headref(&iter->refs->base, iter->ref.refname)))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (iter->prefix &&
|
||||
strncmp(iter->prefix, iter->ref.refname, strlen(iter->prefix))) {
|
||||
|
Reference in New Issue
Block a user