]> git.ipfire.org Git - thirdparty/git.git/blobdiff - templates/hooks--fsmonitor-watchman.sample
fsmonitor: query watchman with right valid json
[thirdparty/git.git] / templates / hooks--fsmonitor-watchman.sample
index 14ed0aa42de0f291c0f696922110e70544c3dae2..23e856f5deeb7f564afc22f2beed54449c2d3afb 100755 (executable)
@@ -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"]]
                }]