diff options
author | Karthik Nayak <karthik.188@gmail.com> | 2015-07-07 21:36:16 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-03 10:25:28 -0700 |
commit | ee2bd06b0f735a00ce0216ca1d3391b13722d987 (patch) | |
tree | 0f004ed7fdcf5f22ff234a83e4c07b214bbdfa98 /builtin | |
parent | f266c9163b34ec55e453d27e1ed246d67ee3ced0 (diff) | |
download | git-ee2bd06b0f735a00ce0216ca1d3391b13722d987.tar.gz git-ee2bd06b0f735a00ce0216ca1d3391b13722d987.tar.xz |
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>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/tag.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/tag.c b/builtin/tag.c index 767162e3a..071d00165 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -86,6 +86,11 @@ static int in_commit_list(const struct commit_list *want, struct commit *c) return 0; } +/* + * The entire code segment for supporting the --contains option has been + * copied over to ref-filter.{c,h}. This will be deleted evetually when + * we port tag.c to use ref-filter APIs. + */ enum contains_result { CONTAINS_UNKNOWN = -1, CONTAINS_NO = 0, |