Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fsmonitor: query watchman with right valid json
In rare circumstances where the current git index does not carry the last_update_token, the fsmonitor v2 hook will be invoked with an empty string which would caused the final rendered json to be invalid. ["query", "/path/to/my/git/repository/", { "since": , "fields": ["name"], "expression": ["not", ["dirname", ".git"]] }] Which will left user with the following error message > git status failed to parse command from stdin: line 2, column 13, position 67: unexpected token near ',' Watchman: command returned no output. Falling back to scanning... Hide the "since" field in json query when "last_update_token" is empty. Co-authored-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Son Luong Ngoc <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
- Loading branch information