26
}
27
28
write_integration_script () {
29
- write_script .git/hooks/fsmonitor-test<<-\EOF
29
+ test_hook --setup --clobber fsmonitor-test<<-\EOF
30
if test "$#" -ne 2
31
then
32
echo "$0: exactly 2 arguments expected"
108
109
# test that "update-index --fsmonitor-valid" sets the fsmonitor valid bit
110
test_expect_success 'update-index --fsmonitor-valid" sets the fsmonitor valid bit' '
111
- write_script .git/hooks/fsmonitor-test<<-\EOF &&
111
+ test_hook fsmonitor-test<<-\EOF &&
112
printf "last_update_token\0"
113
EOF
114
git update-index --fsmonitor &&
169
170
# test that newly added files are marked valid
171
test_expect_success 'newly added files are marked valid' '
172
- write_script .git/hooks/fsmonitor-test<<-\EOF &&
172
+ test_hook --setup --clobber fsmonitor-test<<-\EOF &&
173
printf "last_update_token\0"
174
EOF
175
git add new &&
210
211
# test that *only* files returned by the integration script get flagged as invalid
212
test_expect_success '*only* files returned by the integration script get flagged as invalid' '
213
- write_script .git/hooks/fsmonitor-test<<-\EOF &&
213
+ test_hook --clobber fsmonitor-test<<-\EOF &&
214
printf "last_update_token\0"
215
printf "dir1/modified\0"
216
EOF
231
dirty_repo &&
232
write_integration_script &&
233
git add . &&
234
- write_script .git/hooks/fsmonitor-test<<-\EOF &&
234
+ test_hook --clobber fsmonitor-test<<-\EOF &&
235
EOF
236
git commit -m "to reset" &&
237
git reset HEAD~1 &&
280
# Make sure it's actually skipping the check for modified and untracked
281
# (if enabled) files unless it is told about them.
282
test_expect_success "status doesn't detect unreported modifications" '
283
- write_script .git/hooks/fsmonitor-test<<-\EOF &&
283
+ test_hook --clobber fsmonitor-test<<-\EOF &&
284
printf "last_update_token\0"
285
:>marker
286
EOF
414
git -C sparse sparse-checkout init --cone --sparse-index &&
415
git -C sparse sparse-checkout set dir1 dir2 &&
416
417
- write_script .git/hooks/fsmonitor-test <<-\EOF &&
417
+ test_hook --clobber fsmonitor-test <<-\EOF &&
418
printf "last_update_token\0"
419
EOF
420
git -C full config core.fsmonitor ../.git/hooks/fsmonitor-test &&
421
git -C sparse config core.fsmonitor ../.git/hooks/fsmonitor-test &&
422
check_sparse_index_behavior ! &&
423
424
- write_script .git/hooks/fsmonitor-test <<-\EOF &&
424
+ test_hook --clobber fsmonitor-test <<-\EOF &&
425
printf "last_update_token\0"
426
printf "dir1/modified\0"
427
EOF
439
440
# This one modifies outside the sparse-checkout definition
441
# and hence we expect to expand the sparse-index.
442
- write_script .git/hooks/fsmonitor-test <<-\EOF &&
442
+ test_hook --clobber fsmonitor-test <<-\EOF &&
443
printf "last_update_token\0"
444
printf "dir1a/modified\0"
445
EOF