diff --git a/t/t7519/fsmonitor-watchman b/t/t7519/fsmonitor-watchman index cca3d71e90..51330f8b3d 100755 --- a/t/t7519/fsmonitor-watchman +++ b/t/t7519/fsmonitor-watchman @@ -50,9 +50,6 @@ launch_watchman(); sub launch_watchman { - # Set input record separator - local $/ = 0666; - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j') or die "open2() failed: $!\n" . "Falling back to scanning...\n"; @@ -83,7 +80,8 @@ sub launch_watchman { close $fh; print CHLD_IN $query; - my $response = ; + close CHLD_IN; + my $response = do {local $/; }; open ($fh, ">", ".git/watchman-response.json"); print $fh $response; diff --git a/templates/hooks--fsmonitor-watchman.sample b/templates/hooks--fsmonitor-watchman.sample index c68038ef00..9eba8a7409 100755 --- a/templates/hooks--fsmonitor-watchman.sample +++ b/templates/hooks--fsmonitor-watchman.sample @@ -49,9 +49,6 @@ launch_watchman(); sub launch_watchman { - # Set input record separator - local $/ = 0666; - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j') or die "open2() failed: $!\n" . "Falling back to scanning...\n"; @@ -78,7 +75,8 @@ sub launch_watchman { END print CHLD_IN $query; - my $response = ; + close CHLD_IN; + my $response = do {local $/; }; die "Watchman: command returned no output.\n" . "Falling back to scanning...\n" if $response eq "";