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>
This commit is contained in:
Karthik Nayak
2015-07-07 21:36:12 +05:30
committed by Junio C Hamano
parent 5afcb90560
commit 35257aa012
3 changed files with 81 additions and 4 deletions

View File

@ -31,6 +31,7 @@ struct ref_array_item {
unsigned char objectname[20];
int flag;
const char *symref;
struct commit *commit;
struct atom_value *value;
char refname[FLEX_ARRAY];
};
@ -43,6 +44,13 @@ struct ref_array {
struct ref_filter {
const char **name_patterns;
struct sha1_array points_at;
enum {
REF_FILTER_MERGED_NONE = 0,
REF_FILTER_MERGED_INCLUDE,
REF_FILTER_MERGED_OMIT
} merge;
struct commit *merge_commit;
};
struct ref_filter_cbdata {