From: Karthik Nayak Date: Sat, 17 Oct 2015 18:23:44 GMT Subject: [PATCH] tag.c: use the correct algorithm for the '--contains' option Message-ID: <1445106224-21013-1-git-send-email-Karthik.188@gmail.com> In-Reply-To: In b7cc53e92c806b73e14b03f60c17b7c29e52b4a4 we port tag.c to use ref-filter APIs for filtering and printing refs. But that commit missed out on setting 'filter->with_commit_tag_algo' which would ensure the correct algorithm is used for the '--contains' option. As reported by Jerry Snitselaar, this causes the option to work way slower than expected, fix this by setting 'filter->with_commit_tag_algo' in tag.c before calling 'filter_refs()'. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak Tested-by: Jerry Snitselaar --- builtin/tag.c | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/tag.c b/builtin/tag.c index 977a18c..2c5a9f1 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -49,6 +49,7 @@ static int list_tags(struct ref_filter *filter, struct ref_sorting *sorting) format = "%(refname:short)"; verify_ref_format(format); + filter->with_commit_tag_algo = 1; filter_refs(&array, filter, FILTER_REFS_TAGS); ref_array_sort(sorting, &array); -- 2.6.1