summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ref-filter.c9
-rwxr-xr-xt/t6300-for-each-ref.sh2
2 files changed, 10 insertions, 1 deletions
diff --git a/ref-filter.c b/ref-filter.c
index c0e257c79e..85057234ee 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -1769,6 +1769,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);
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index 1adb9580b1..3bb901d50f 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -795,7 +795,7 @@ test_expect_success ':remotename and :remoteref' '
)
'
-test_expect_failure 'for-each-ref --ignore-case ignores case' '
+test_expect_success 'for-each-ref --ignore-case ignores case' '
>expect &&
git for-each-ref --format="%(refname)" refs/heads/MASTER >actual &&
test_cmp expect actual &&