From b4f61b7fa455b6bea2a12d46c59d8685f761018b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 16 Dec 2017 13:12:23 +0100 Subject: p7519: improve check for prerequisite WATCHMAN The return code of command -v with a non-existing command is 1 in bash and 127 in dash. Use that return code directly to allow the script to work with dash and without watchman (e.g. on Debian). While at it stop redirecting the output. stderr is redirected to /dev/null by test_lazy_prereq already, and stdout can actually be useful -- the path of the found watchman executable is sent there, but it's shown only if the script was run with --verbose. Signed-off-by: Rene Scharfe Acked-by: Ben Peart Signed-off-by: Junio C Hamano --- t/perf/p7519-fsmonitor.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 't') diff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh index 16d1bf72e..65e145c02 100755 --- a/t/perf/p7519-fsmonitor.sh +++ b/t/perf/p7519-fsmonitor.sh @@ -40,8 +40,7 @@ test_lazy_prereq UNTRACKED_CACHE ' ' test_lazy_prereq WATCHMAN ' - { command -v watchman >/dev/null 2>&1; ret=$?; } && - test $ret -ne 1 + command -v watchman ' if test_have_prereq WATCHMAN -- cgit v1.2.1