$git_work_tree = Cwd::cwd();
}
-my $retry = 1;
-
launch_watchman();
sub launch_watchman {
my $o = $json_pkg->new->utf8->decode($response);
- if ($retry > 0 and $o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) {
+ if ($o->{error} and $o->{error} =~ m/unable to resolve root .* directory (.*) is not watched/) {
print STDERR "Adding '$git_work_tree' to watchman's watch list.\n";
- $retry--;
qx/watchman watch "$git_work_tree"/;
die "Failed to make watchman watch '$git_work_tree'.\n" .
"Falling back to scanning...\n" if $? != 0;
close $fh;
print "/\0";
- eval { launch_watchman() };
exit 0;
}
my $git_work_tree = get_working_dir();
-my $retry = 1;
-
my $json_pkg;
eval {
require JSON::XS;
sub is_work_tree_watched {
my ($output) = @_;
my $error = $output->{error};
- if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) {
- $retry--;
+ if ($error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) {
my $response = qx/watchman watch "$git_work_tree"/;
die "Failed to make watchman watch '$git_work_tree'.\n" .
"Falling back to scanning...\n" if $? != 0;
# Watchman query just to get it over with now so we won't pay
# the cost in git to look up each individual file.
my $o = watchman_clock();
- $error = $output->{error};
+ $error = $o->{error};
die "Watchman: $error.\n" .
"Falling back to scanning...\n" if $error;
output_result($o->{clock}, ("/"));
- $last_update_token = $o->{clock};
-
- eval { launch_watchman() };
return 0;
}
my $git_work_tree = get_working_dir();
-my $retry = 1;
-
my $json_pkg;
eval {
require JSON::XS;
sub is_work_tree_watched {
my ($output) = @_;
my $error = $output->{error};
- if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) {
- $retry--;
+ if ($error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) {
my $response = qx/watchman watch "$git_work_tree"/;
die "Failed to make watchman watch '$git_work_tree'.\n" .
"Falling back to scanning...\n" if $? != 0;
# Watchman query just to get it over with now so we won't pay
# the cost in git to look up each individual file.
my $o = watchman_clock();
- $error = $output->{error};
+ $error = $o->{error};
die "Watchman: $error.\n" .
"Falling back to scanning...\n" if $error;
output_result($o->{clock}, ("/"));
- $last_update_token = $o->{clock};
-
- eval { launch_watchman() };
return 0;
}