Merge branch 'mm/usage-log-l-can-take-regex'
[gitweb.git] / t / annotate-tests.sh
index 304c7b7d8714f9f985cddcc91ba3006f668de127..f5c01758ca38b58fc10e30cfac81be5becb0316b 100644 (file)
@@ -1,6 +1,17 @@
 # This file isn't used as a test script directly, instead it is
 # sourced from t8001-annotate.sh and t8002-blame.sh.
 
+if test_have_prereq MINGW
+then
+  sanitize_L () {
+       echo "$1" | sed 'sX\(^-L\|,\)\^\?/X&\\;*Xg'
+  }
+else
+  sanitize_L () {
+       echo "$1"
+  }
+fi
+
 check_count () {
        head= &&
        file='file' &&
@@ -10,6 +21,7 @@ check_count () {
                case "$1" in
                -h) head="$2"; shift; shift ;;
                -f) file="$2"; shift; shift ;;
+               -L*) options="$options $(sanitize_L "$1")"; shift ;;
                -*) options="$options $1"; shift ;;
                *) break ;;
                esac
@@ -393,7 +405,7 @@ test_expect_success 'setup -L :regex' '
        mv hello.c hello.orig &&
        echo "#include <stdio.h>" >hello.c &&
        cat hello.orig >>hello.c &&
-       tr Q "\\t" >>hello.c <<-\EOF
+       tr Q "\\t" >>hello.c <<-\EOF &&
        void mail()
        {
        Qputs("mail");