]> git.ipfire.org Git - thirdparty/git.git/commit - ref-filter.h
ref-filter: implement '--contains' option
authorKarthik Nayak <karthik.188@gmail.com>
Tue, 7 Jul 2015 16:06:16 +0000 (21:36 +0530)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Aug 2015 17:25:28 +0000 (10:25 -0700)
commitee2bd06b0f735a00ce0216ca1d3391b13722d987
tree0f004ed7fdcf5f22ff234a83e4c07b214bbdfa98
parentf266c9163b34ec55e453d27e1ed246d67ee3ced0
ref-filter: implement '--contains' option

'tag -l' and 'branch -l' have two different ways of finding
out if a certain ref contains a commit. Implement both these
methods in ref-filter and give the caller of ref-filter API
the option to pick which implementation to be used.

'branch -l' uses 'is_descendant_of()' from commit.c which is
left as the default implementation to be used.

'tag -l' uses a more specific algorithm since ffc4b80. This
implementation is used whenever the 'with_commit_tag_algo' bit
is set in 'struct ref_filter'.

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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/tag.c
ref-filter.c
ref-filter.h