Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 't/t7519-status-fsmonitor.sh')
-rwxr-xr-xt/t7519-status-fsmonitor.sh20
1 files changed, 9 insertions, 11 deletions
diff --git a/t/t7519-status-fsmonitor.sh b/t/t7519-status-fsmonitor.sh
index fffc57120d..d4f9c6a837 100755
--- a/t/t7519-status-fsmonitor.sh
+++ b/t/t7519-status-fsmonitor.sh
@@ -26,7 +26,7 @@ dirty_repo () {
}
write_integration_script () {
- write_script .git/hooks/fsmonitor-test<<-\EOF
+ test_hook --setup --clobber fsmonitor-test<<-\EOF
if test "$#" -ne 2
then
echo "$0: exactly 2 arguments expected"
@@ -56,7 +56,6 @@ test_lazy_prereq UNTRACKED_CACHE '
'
test_expect_success 'setup' '
- mkdir -p .git/hooks &&
: >tracked &&
: >modified &&
mkdir dir1 &&
@@ -108,7 +107,7 @@ EOF
# test that "update-index --fsmonitor-valid" sets the fsmonitor valid bit
test_expect_success 'update-index --fsmonitor-valid" sets the fsmonitor valid bit' '
- write_script .git/hooks/fsmonitor-test<<-\EOF &&
+ test_hook fsmonitor-test<<-\EOF &&
printf "last_update_token\0"
EOF
git update-index --fsmonitor &&
@@ -169,7 +168,7 @@ EOF
# test that newly added files are marked valid
test_expect_success 'newly added files are marked valid' '
- write_script .git/hooks/fsmonitor-test<<-\EOF &&
+ test_hook --setup --clobber fsmonitor-test<<-\EOF &&
printf "last_update_token\0"
EOF
git add new &&
@@ -210,7 +209,7 @@ EOF
# test that *only* files returned by the integration script get flagged as invalid
test_expect_success '*only* files returned by the integration script get flagged as invalid' '
- write_script .git/hooks/fsmonitor-test<<-\EOF &&
+ test_hook --clobber fsmonitor-test<<-\EOF &&
printf "last_update_token\0"
printf "dir1/modified\0"
EOF
@@ -231,7 +230,7 @@ test_expect_success 'refresh_index() invalidates fsmonitor cache' '
dirty_repo &&
write_integration_script &&
git add . &&
- write_script .git/hooks/fsmonitor-test<<-\EOF &&
+ test_hook --clobber fsmonitor-test<<-\EOF &&
EOF
git commit -m "to reset" &&
git reset HEAD~1 &&
@@ -280,7 +279,7 @@ do
# Make sure it's actually skipping the check for modified and untracked
# (if enabled) files unless it is told about them.
test_expect_success "status doesn't detect unreported modifications" '
- write_script .git/hooks/fsmonitor-test<<-\EOF &&
+ test_hook --clobber fsmonitor-test<<-\EOF &&
printf "last_update_token\0"
:>marker
EOF
@@ -322,7 +321,6 @@ test_expect_success UNTRACKED_CACHE 'ignore .git changes when invalidating UNTR'
test_create_repo dot-git &&
(
cd dot-git &&
- mkdir -p .git/hooks &&
: >tracked &&
test-tool chmtime =-60 tracked &&
: >modified &&
@@ -414,14 +412,14 @@ test_expect_success 'status succeeds with sparse index' '
git -C sparse sparse-checkout init --cone --sparse-index &&
git -C sparse sparse-checkout set dir1 dir2 &&
- write_script .git/hooks/fsmonitor-test <<-\EOF &&
+ test_hook --clobber fsmonitor-test <<-\EOF &&
printf "last_update_token\0"
EOF
git -C full config core.fsmonitor ../.git/hooks/fsmonitor-test &&
git -C sparse config core.fsmonitor ../.git/hooks/fsmonitor-test &&
check_sparse_index_behavior ! &&
- write_script .git/hooks/fsmonitor-test <<-\EOF &&
+ test_hook --clobber fsmonitor-test <<-\EOF &&
printf "last_update_token\0"
printf "dir1/modified\0"
EOF
@@ -439,7 +437,7 @@ test_expect_success 'status succeeds with sparse index' '
# This one modifies outside the sparse-checkout definition
# and hence we expect to expand the sparse-index.
- write_script .git/hooks/fsmonitor-test <<-\EOF &&
+ test_hook --clobber fsmonitor-test <<-\EOF &&
printf "last_update_token\0"
printf "dir1a/modified\0"
EOF