diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-04-28 15:50:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-04-28 15:50:08 -0700 |
commit | d3fc8dc53a7ef9f33a5d9604b382e24408a9b7be (patch) | |
tree | 5f3a7e6ad3336d850083af8b24e38a2fffe089c9 /refs.c | |
parent | 93d1f196a9b84f449ed405fe9c9c96320b6dffb0 (diff) | |
parent | a6be5e6764aabd4b418f7f365254518ec44c38d8 (diff) | |
download | git-d3fc8dc53a7ef9f33a5d9604b382e24408a9b7be.tar.gz |
Merge branch 'ds/log-exclude-decoration-config'
The "--decorate-refs" and "--decorate-refs-exclude" options "git
log" takes have learned a companion configuration variable
log.excludeDecoration that sits at the lowest priority in the
family.
* ds/log-exclude-decoration-config:
log: add log.excludeDecoration config option
log-tree: make ref_filter_match() a helper method
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 44 |
1 files changed, 0 insertions, 44 deletions
@@ -321,50 +321,6 @@ int ref_exists(const char *refname) return refs_ref_exists(get_main_ref_store(the_repository), refname); } -static int match_ref_pattern(const char *refname, - const struct string_list_item *item) -{ - int matched = 0; - if (item->util == NULL) { - if (!wildmatch(item->string, refname, 0)) - matched = 1; - } else { - const char *rest; - if (skip_prefix(refname, item->string, &rest) && - (!*rest || *rest == '/')) - matched = 1; - } - return matched; -} - -int ref_filter_match(const char *refname, - const struct string_list *include_patterns, - const struct string_list *exclude_patterns) -{ - struct string_list_item *item; - - if (exclude_patterns && exclude_patterns->nr) { - for_each_string_list_item(item, exclude_patterns) { - if (match_ref_pattern(refname, item)) - return 0; - } - } - - if (include_patterns && include_patterns->nr) { - int found = 0; - for_each_string_list_item(item, include_patterns) { - if (match_ref_pattern(refname, item)) { - found = 1; - break; - } - } - - if (!found) - return 0; - } - return 1; -} - static int filter_refs(const char *refname, const struct object_id *oid, int flags, void *data) { |