diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-06-13 15:53:43 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-06-13 15:53:43 -0700 |
| commit | 70055ef1bf813e184d2594a0dd8f733caead6ed3 (patch) | |
| tree | 747db9c473dabe86bde6d039bf19b31b7d326de0 | |
| parent | Merge branch 'zh/read-cache-copy-name-entry-fix' (diff) | |
| parent | fsmonitor: query watchman with right valid json (diff) | |
| download | git-70055ef1bf813e184d2594a0dd8f733caead6ed3.tar.gz git-70055ef1bf813e184d2594a0dd8f733caead6ed3.zip | |
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
| -rwxr-xr-x | templates/hooks--fsmonitor-watchman.sample | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/templates/hooks--fsmonitor-watchman.sample b/templates/hooks--fsmonitor-watchman.sample index 14ed0aa42d..23e856f5de 100755 --- a/templates/hooks--fsmonitor-watchman.sample +++ b/templates/hooks--fsmonitor-watchman.sample @@ -86,12 +86,13 @@ sub watchman_query { # recency index to select candidate nodes and "fields" to limit the # output to file names only. Then we're using the "expression" term to # further constrain the results. + my $last_update_line = ""; if (substr($last_update_token, 0, 1) eq "c") { $last_update_token = "\"$last_update_token\""; + $last_update_line = qq[\n"since": $last_update_token,]; } my $query = <<" END"; - ["query", "$git_work_tree", { - "since": $last_update_token, + ["query", "$git_work_tree", {$last_update_line "fields": ["name"], "expression": ["not", ["dirname", ".git"]] }] |
