t7002: set test prerequisite "external-grep" if supported
[gitweb.git] / t / t7002-grep.sh
index b4709e28b5107cfad95290a78ac0260df0485213..23eeb767f97d9640c44e48d396d1b76afb0fa5b9 100755 (executable)
@@ -8,6 +8,18 @@ test_description='git grep various.
 
 . ./test-lib.sh
 
+test_expect_success 'Check for external grep support' '
+       case "$(git grep -h 2>&1|grep ext-grep)" in
+       *"(default)"*)
+               test_set_prereq EXTGREP
+               true;;
+       *"(ignored by this build)"*)
+               true;;
+       *)
+               false;;
+       esac
+'
+
 cat >hello.c <<EOF
 #include <stdio.h>
 int main(int argc, const char **argv)