From 5b4f28510f36062134390ad8818721c1d4a2760f Mon Sep 17 00:00:00 2001 From: Karthik Nayak Date: Thu, 10 Sep 2015 21:18:23 +0530 Subject: ref-filter: add option to filter out tags, branches and remotes Add a function called 'for_each_fullref_in()' to refs.{c,h} which iterates through each ref for the given path without trimming the path and also accounting for broken refs, if mentioned. Add 'filter_ref_kind()' in ref-filter.c to check the kind of ref being handled and return the kind to 'ref_filter_handler()', where we discard refs which we do not need and assign the kind to needed refs. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak Signed-off-by: Junio C Hamano --- refs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'refs.h') diff --git a/refs.h b/refs.h index 6a3fa6d41d..0267649832 100644 --- a/refs.h +++ b/refs.h @@ -173,6 +173,7 @@ typedef int each_ref_fn(const char *refname, extern int head_ref(each_ref_fn fn, void *cb_data); extern int for_each_ref(each_ref_fn fn, void *cb_data); extern int for_each_ref_in(const char *prefix, each_ref_fn fn, void *cb_data); +extern int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data, unsigned int broken); extern int for_each_tag_ref(each_ref_fn fn, void *cb_data); extern int for_each_branch_ref(each_ref_fn fn, void *cb_data); extern int for_each_remote_ref(each_ref_fn fn, void *cb_data); -- cgit v1.2.1