t6300: add a test for --ignore-case
[gitweb.git] / t / t6300-for-each-ref.sh
index c128dfc5790790de9edf1b4d2cfa8b028c1036bc..1adb9580b1edda08afd6035f92c05e977b40fbe3 100755 (executable)
@@ -373,11 +373,8 @@ test_expect_success 'Quoting style: tcl' '
 
 for i in "--perl --shell" "-s --python" "--python --tcl" "--tcl --perl"; do
        test_expect_success "more than one quoting style: $i" "
-               git for-each-ref $i 2>&1 | (read line &&
-               case \$line in
-               \"error: more than one quoting style\"*) : happy;;
-               *) false
-               esac)
+               test_must_fail git for-each-ref $i 2>err &&
+               grep '^error: more than one quoting style' err
        "
 done
 
@@ -798,4 +795,15 @@ test_expect_success ':remotename and :remoteref' '
        )
 '
 
+test_expect_failure 'for-each-ref --ignore-case ignores case' '
+       >expect &&
+       git for-each-ref --format="%(refname)" refs/heads/MASTER >actual &&
+       test_cmp expect actual &&
+
+       echo refs/heads/master >expect &&
+       git for-each-ref --format="%(refname)" --ignore-case \
+               refs/heads/MASTER >actual &&
+       test_cmp expect actual
+'
+
 test_done