Skip to content

Commit 70055ef

Browse files
committed
Merge branch 'sn/fsmonitor-missing-clock'
Sample watchman interface hook sometimes failed to produce correctly formatted JSON message, which has been corrected. * sn/fsmonitor-missing-clock: fsmonitor: query watchman with right valid json
2 parents 113656e + 134047b commit 70055ef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

templates/hooks--fsmonitor-watchman.sample

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,13 @@ sub watchman_query {
8686
# recency index to select candidate nodes and "fields" to limit the
8787
# output to file names only. Then we're using the "expression" term to
8888
# further constrain the results.
89+
my $last_update_line = "";
8990
if (substr($last_update_token, 0, 1) eq "c") {
9091
$last_update_token = "\"$last_update_token\"";
92+
$last_update_line = qq[\n"since": $last_update_token,];
9193
}
9294
my $query = <<" END";
93-
["query", "$git_work_tree", {
94-
"since": $last_update_token,
95+
["query", "$git_work_tree", {$last_update_line
9596
"fields": ["name"],
9697
"expression": ["not", ["dirname", ".git"]]
9798
}]

0 commit comments

Comments
 (0)