diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-07-25 00:50:44 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-25 00:50:44 +0300 |
commit | 43013305887c2b81858a0741f39872f8ed5f27d6 (patch) | |
tree | 2d93dc7033f8f452d870b9d296a009ddf859f6cd /ref-filter.c | |
parent | 3467e25e1e72a6ef7983b228d9788357385471b7 (diff) | |
parent | e674eb2528229ac7f9c911369a39e7a979bfe75a (diff) |
Merge branch 'jk/for-each-ref-icase'
The "--ignore-case" option of "git for-each-ref" (and its friends)
did not work correctly, which has been fixed.
* jk/for-each-ref-icase:
ref-filter: avoid backend filtering with --ignore-case
for-each-ref: consistently pass WM_IGNORECASE flag
t6300: add a test for --ignore-case
Diffstat (limited to 'ref-filter.c')
-rw-r--r-- | ref-filter.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ref-filter.c b/ref-filter.c index 0ab893a250..492f2b770d 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -1814,7 +1814,7 @@ static int match_name_as_path(const struct ref_filter *filter, const char *refna refname[plen] == '/' || p[plen-1] == '/')) return 1; - if (!wildmatch(p, refname, WM_PATHNAME)) + if (!wildmatch(p, refname, flags)) return 1; } return 0; @@ -1869,6 +1869,15 @@ static int for_each_fullref_in_pattern(struct ref_filter *filter, return for_each_fullref_in("", cb, cb_data, broken); } + if (filter->ignore_case) { + /* + * we can't handle case-insensitive comparisons, + * so just return everything and let the caller + * sort it out. + */ + return for_each_fullref_in("", cb, cb_data, broken); + } + if (!filter->name_patterns[0]) { /* no patterns; we have to look at everything */ return for_each_fullref_in("", cb, cb_data, broken); |