[PATCH] tag.c: use the correct algorithm for the '--contains' option
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Oct 17, 2015, 18:23 UTC
- Message-ID
- <1445106224-21013-1-git-send-email-Karthik.188@gmail.com>
- In-Reply-To
- <AOLa=ZSjNjey3zWozFkyFw-X-BPtsVNpQKqG5hO9-7qJOBR_KA@mail.gmail.com>
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 <christian.couder@gmail.com> Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Tested-by: Jerry Snitselaar <jsnitsel@redhat.com> --- 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