Skip to content

Commit b4f61b7

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Acked-by: Ben Peart <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 614a718 commit b4f61b7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

t/perf/p7519-fsmonitor.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ test_lazy_prereq UNTRACKED_CACHE '
4040
'
4141

4242
test_lazy_prereq WATCHMAN '
43-
{ command -v watchman >/dev/null 2>&1; ret=$?; } &&
44-
test $ret -ne 1
43+
command -v watchman
4544
'
4645

4746
if test_have_prereq WATCHMAN

0 commit comments

Comments
 (0)