diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2013-05-04 18:06:14 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-05-11 11:20:38 +0200 |
commit | c58cac12c24fbb127cf1928bec20decb007a75e8 (patch) | |
tree | b41792fc37e70da0c456926aeb82f311dc3e000c /include/git2/sys | |
parent | 9bd89d962265b399b537e41058d40a6aeab00e64 (diff) | |
download | libgit2-c58cac12c24fbb127cf1928bec20decb007a75e8.tar.gz |
Introduce a glob-filtering iterator
If the backend doesn't provide support for it, the matching is done in
refdb on top of a normal iterator.
Diffstat (limited to 'include/git2/sys')
-rw-r--r-- | include/git2/sys/refdb_backend.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/git2/sys/refdb_backend.h b/include/git2/sys/refdb_backend.h index f5eacd105..8dbf38ca9 100644 --- a/include/git2/sys/refdb_backend.h +++ b/include/git2/sys/refdb_backend.h @@ -30,10 +30,11 @@ GIT_BEGIN_DECL * ... * } * - * and assing `iter->parent.backend` to your `git_refdb_backend`. + * and assign `iter->parent.backend` to your `git_refdb_backend`. */ struct git_reference_iterator { git_refdb_backend *backend; + char *glob; }; /** An instance for a custom backend */ @@ -68,6 +69,17 @@ struct git_refdb_backend { struct git_refdb_backend *backend); /** + * Allocate a glob-filtering iterator object for the backend. + * + * A refdb implementation may provide this function. If it's + * not available, the glob matching will be done by the frontend. + */ + int (*iterator_glob)( + git_reference_iterator **iter, + struct git_refdb_backend *backend, + const char *glob); + + /** * Return the current value and advance the iterator. * * A refdb implementation must provide this function. |