From: Karthik Nayak <redacted>
Add an option in 'filter_refs()' to use 'for_each_tag_ref()'
and filter refs. This type checking is done by adding a
'FILTER_REFS_TAGS' in 'ref-filter.h'
Mentored-by: Christian Couder [off-list ref]
Mentored-by: Matthieu Moy [off-list ref]
Signed-off-by: Karthik Nayak <redacted>
---
ref-filter.c | 2 ++
ref-filter.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/ref-filter.c b/ref-filter.c
index b81a08d..771c48d 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -1149,6 +1149,8 @@ int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned int
ret = for_each_rawref(ref_filter_handler, &ref_cbdata);
else if (type & FILTER_REFS_ALL)
ret = for_each_ref(ref_filter_handler, &ref_cbdata);
+ else if (type & FILTER_REFS_TAGS)
+ ret = for_each_tag_ref(ref_filter_handler, &ref_cbdata);
else if (type)
die("filter_refs: invalid type");
diff --git a/ref-filter.h b/ref-filter.h
index 12ffbc5..c18781b 100644
--- a/ref-filter.h
+++ b/ref-filter.h
@@ -15,6 +15,7 @@
#define FILTER_REFS_INCLUDE_BROKEN 0x1
#define FILTER_REFS_ALL 0x2
+#define FILTER_REFS_TAGS 0x4
struct atom_value {
const char *s;--
2.4.6