From: Chris Poucet <poucet@xxxxxxxxxx> The metas namespace will contain refs for changes in progress. Add support for searching this namespace. Signed-off-by: Chris Poucet <poucet@xxxxxxxxxx> --- ref-filter.c | 8 ++++++-- ref-filter.h | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index fd1cb14b0f1..6a1789c623f 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -2200,7 +2200,8 @@ static int ref_kind_from_refname(const char *refname) } ref_kind[] = { { "refs/heads/" , FILTER_REFS_BRANCHES }, { "refs/remotes/" , FILTER_REFS_REMOTES }, - { "refs/tags/", FILTER_REFS_TAGS} + { "refs/tags/", FILTER_REFS_TAGS}, + { "refs/metas/", FILTER_REFS_CHANGES } }; if (!strcmp(refname, "HEAD")) @@ -2218,7 +2219,8 @@ static int filter_ref_kind(struct ref_filter *filter, const char *refname) { if (filter->kind == FILTER_REFS_BRANCHES || filter->kind == FILTER_REFS_REMOTES || - filter->kind == FILTER_REFS_TAGS) + filter->kind == FILTER_REFS_TAGS || + filter->kind == FILTER_REFS_CHANGES) return filter->kind; return ref_kind_from_refname(refname); } @@ -2435,6 +2437,8 @@ int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned int ret = for_each_fullref_in("refs/remotes/", ref_filter_handler, &ref_cbdata); else if (filter->kind == FILTER_REFS_TAGS) ret = for_each_fullref_in("refs/tags/", ref_filter_handler, &ref_cbdata); + else if (filter->kind == FILTER_REFS_CHANGES) + ret = for_each_fullref_in("refs/metas/", ref_filter_handler, &ref_cbdata); else if (filter->kind & FILTER_REFS_ALL) ret = for_each_fullref_in_pattern(filter, ref_filter_handler, &ref_cbdata); if (!ret && (filter->kind & FILTER_REFS_DETACHED_HEAD)) diff --git a/ref-filter.h b/ref-filter.h index aa0eea4ecf5..db3ee44e4dc 100644 --- a/ref-filter.h +++ b/ref-filter.h @@ -16,9 +16,11 @@ #define FILTER_REFS_TAGS 0x0002 #define FILTER_REFS_BRANCHES 0x0004 #define FILTER_REFS_REMOTES 0x0008 -#define FILTER_REFS_OTHERS 0x0010 +#define FILTER_REFS_CHANGES 0x0010 +#define FILTER_REFS_OTHERS 0x0040 #define FILTER_REFS_ALL (FILTER_REFS_TAGS | FILTER_REFS_BRANCHES | \ - FILTER_REFS_REMOTES | FILTER_REFS_OTHERS) + FILTER_REFS_REMOTES | FILTER_REFS_OTHERS | \ + FILTER_REFS_CHANGES) #define FILTER_REFS_DETACHED_HEAD 0x0020 #define FILTER_REFS_KIND_MASK (FILTER_REFS_ALL | FILTER_REFS_DETACHED_HEAD) -- gitgitgadget