diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-10-18 14:19:01 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-18 14:19:01 +0900 |
commit | 501ec0dad31a5379ac7620f8655de882844fd3c1 (patch) | |
tree | f70bdfbae0b2f99e4aa1b278bd22b72609c3487c /builtin | |
parent | Merge branch 'mh/for-each-string-list-item-empty-fix' into maint (diff) | |
parent | describe: fix matching to actually match all patterns (diff) | |
download | tgif-501ec0dad31a5379ac7620f8655de882844fd3c1.tar.xz |
Merge branch 'jk/describe-omit-some-refs' into maint
"git describe --match" learned to take multiple patterns in v2.13
series, but the feature ignored the patterns after the first one
and did not work at all. This has been fixed.
* jk/describe-omit-some-refs:
describe: fix matching to actually match all patterns
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/describe.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin/describe.c b/builtin/describe.c index 89ea1cdd60..94ff2fba0b 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -155,18 +155,21 @@ static int get_name(const char *path, const struct object_id *oid, int flag, voi * pattern. */ if (patterns.nr) { + int found = 0; struct string_list_item *item; if (!is_tag) return 0; for_each_string_list_item(item, &patterns) { - if (!wildmatch(item->string, path + 10, 0)) + if (!wildmatch(item->string, path + 10, 0)) { + found = 1; break; + } + } - /* If we get here, no pattern matched. */ + if (!found) return 0; - } } /* Is it annotated? */ |