diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2017-03-20 16:33:08 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-04-14 10:54:31 (GMT) |
commit | e121b9cb5f358c9779e02a2bf96fc545a896ab13 (patch) | |
tree | 0ed10b75766e68dc634ea4f148a796d41a44ff6b /refs | |
parent | 470be518623b0ca7a30bdb1fcef483f63a8e72ec (diff) | |
download | git-e121b9cb5f358c9779e02a2bf96fc545a896ab13.zip git-e121b9cb5f358c9779e02a2bf96fc545a896ab13.tar.gz git-e121b9cb5f358c9779e02a2bf96fc545a896ab13.tar.bz2 |
refs_ref_iterator_begin(): new function
Extract a new function from `do_for_each_ref()`. It will be useful
elsewhere.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs')
-rw-r--r-- | refs/refs-internal.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/refs/refs-internal.h b/refs/refs-internal.h index 6ee9f20..545989a 100644 --- a/refs/refs-internal.h +++ b/refs/refs-internal.h @@ -336,6 +336,17 @@ struct ref_iterator *empty_ref_iterator_begin(void); int is_empty_ref_iterator(struct ref_iterator *ref_iterator); /* + * Return an iterator that goes over each reference in `refs` for + * which the refname begins with prefix. If trim is non-zero, then + * trim that many characters off the beginning of each refname. flags + * can be DO_FOR_EACH_INCLUDE_BROKEN to include broken references in + * the iteration. + */ +struct ref_iterator *refs_ref_iterator_begin( + struct ref_store *refs, + const char *prefix, int trim, int flags); + +/* * A callback function used to instruct merge_ref_iterator how to * interleave the entries from iter0 and iter1. The function should * return one of the constants defined in enum iterator_selection. It |