summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Karthik Nayak <karthik.188@gmail.com>2015-07-07 21:36:12 +0530
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-08-03 10:25:28 -0700
commit35257aa01203bae74f9fb856fb02c10c4b3836e6 (patch)
treebcf796961dbfa72b519900247f4bbb08f746a516 /builtin
parentref-filter: add parse_opt_merge_filter() (diff)
downloadtgif-35257aa01203bae74f9fb856fb02c10c4b3836e6.tar.xz
ref-filter: implement '--merged' and '--no-merged' options
In 'branch -l' we have '--merged' option which only lists refs (branches) merged into the named commit and '--no-merged' option which only lists refs (branches) not merged into the named commit. Implement these two options in ref-filter.{c,h} so that other commands can benefit from this. Based-on-patch-by: Jeff King <peff@peff.net> 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/branch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index ddd90e6b1c..e63102e47b 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -635,6 +635,10 @@ static int print_ref_list(int kinds, int detached, int verbose, int abbrev, stru
cb.pattern = pattern;
cb.ret = 0;
for_each_rawref(append_ref, &cb);
+ /*
+ * The following implementation is currently duplicated in ref-filter. It
+ * will eventually be removed when we port branch.c to use ref-filter APIs.
+ */
if (merge_filter != NO_FILTER) {
struct commit *filter;
filter = lookup_commit_reference_gently(merge_filter_ref, 0);