path: root/builtin/branch.c
diff options
authorKarthik Nayak <>2015-07-07 16:06:12 (GMT)
committerJunio C Hamano <>2015-08-03 17:25:28 (GMT)
commit35257aa01203bae74f9fb856fb02c10c4b3836e6 (patch)
treebcf796961dbfa72b519900247f4bbb08f746a516 /builtin/branch.c
parent5afcb90560586765bf21fb09959a8b4497804639 (diff)
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 <> Mentored-by: Christian Couder <> Mentored-by: Matthieu Moy <> Signed-off-by: Karthik Nayak <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/branch.c')
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);