Skip to content

Commit b533708

Browse files
jeffhostetlergitster
authored andcommitted
t7527: FSMonitor tests for directory moves
Create unit tests to move a directory. Verify that `git status` gives the same result with and without FSMonitor enabled. Signed-off-by: Jeff Hostetler <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 95a4e78 commit b533708

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

t/t7527-builtin-fsmonitor.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,16 @@ test_expect_success 'setup' '
274274
trace*
275275
EOF
276276
277+
mkdir -p T1/T2/T3/T4 &&
278+
echo 1 >T1/F1 &&
279+
echo 1 >T1/T2/F1 &&
280+
echo 1 >T1/T2/T3/F1 &&
281+
echo 1 >T1/T2/T3/T4/F1 &&
282+
echo 2 >T1/F2 &&
283+
echo 2 >T1/T2/F2 &&
284+
echo 2 >T1/T2/T3/F2 &&
285+
echo 2 >T1/T2/T3/T4/F2 &&
286+
277287
git -c core.fsmonitor=false add . &&
278288
test_tick &&
279289
git -c core.fsmonitor=false commit -m initial &&
@@ -356,6 +366,19 @@ directory_to_file () {
356366
echo 1 >dir1
357367
}
358368

369+
move_directory_contents_deeper() {
370+
mkdir T1/_new_ &&
371+
mv T1/[A-Z]* T1/_new_
372+
}
373+
374+
move_directory_up() {
375+
mv T1/T2/T3 T1
376+
}
377+
378+
move_directory() {
379+
mv T1/T2/T3 T1/T2/NewT3
380+
}
381+
359382
# The next few test cases confirm that our fsmonitor daemon sees each type
360383
# of OS filesystem notification that we care about. At this layer we just
361384
# ensure we are getting the OS notifications and do not try to confirm what
@@ -660,6 +683,10 @@ do
660683
matrix_try $uc_val $fsm_val file_to_directory
661684
matrix_try $uc_val $fsm_val directory_to_file
662685

686+
matrix_try $uc_val $fsm_val move_directory_contents_deeper
687+
matrix_try $uc_val $fsm_val move_directory_up
688+
matrix_try $uc_val $fsm_val move_directory
689+
663690
if test $fsm_val = true
664691
then
665692
test_expect_success "Matrix[uc:$uc_val][fsm:$fsm_val] disable fsmonitor at end" '

0 commit comments

Comments
 (0)