summaryrefslogtreecommitdiff
path: root/builtin/branch.c
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2015-07-07 16:06:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-08-03 17:25:28 (GMT)
commit35257aa01203bae74f9fb856fb02c10c4b3836e6 (patch)
treebcf796961dbfa72b519900247f4bbb08f746a516 /builtin/branch.c
parent5afcb90560586765bf21fb09959a8b4497804639 (diff)
downloadgit-35257aa01203bae74f9fb856fb02c10c4b3836e6.zip
git-35257aa01203bae74f9fb856fb02c10c4b3836e6.tar.gz
git-35257aa01203bae74f9fb856fb02c10c4b3836e6.tar.bz2
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/branch.c')
-rw-r--r--builtin/branch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index ddd90e6..e63102e 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);