5c8cdcfd80
Test the ability to add/remove the fsmonitor index extension via update-index. Test that dirty files returned from the integration script are properly represented in the index extension and verify that ls-files correctly reports their state. Test that ensure status results are correct when using the new fsmonitor extension. Test untracked, modified, and new files by ensuring the results are identical to when not using the extension. Test that if the fsmonitor extension doesn't tell git about a change, it doesn't discover it on its own. This ensures git is honoring the extension and that we get the performance benefits desired. Three test integration scripts are provided: fsmonitor-all - marks all files as dirty fsmonitor-none - marks no files as dirty fsmonitor-watchman - integrates with Watchman with debug logging To run tests in the test suite while utilizing fsmonitor: First copy t/t7519/fsmonitor-all to a location in your path and then set GIT_FORCE_PRELOAD_TEST=true and GIT_FSMONITOR_TEST=fsmonitor-all and run your tests. Note: currently when using the test script fsmonitor-watchman on Windows, many tests fail due to a reported but not yet fixed bug in Watchman where it holds on to handles for directories and files which prevents the test directory from being cleaned up properly. Signed-off-by: Ben Peart <benpeart@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
25 lines
539 B
Bash
Executable File
25 lines
539 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# An test hook script to integrate with git to test fsmonitor.
|
|
#
|
|
# The hook is passed a version (currently 1) and a time in nanoseconds
|
|
# formatted as a string and outputs to stdout all files that have been
|
|
# modified since the given time. Paths must be relative to the root of
|
|
# the working tree and separated by a single NUL.
|
|
#
|
|
#echo "$0 $*" >&2
|
|
|
|
if test "$#" -ne 2
|
|
then
|
|
echo "$0: exactly 2 arguments expected" >&2
|
|
exit 2
|
|
fi
|
|
|
|
if test "$1" != 1
|
|
then
|
|
echo "Unsupported core.fsmonitor hook version." >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "/"
|