From: Junio C Hamano Date: Fri, 10 Jun 2022 22:04:14 +0000 (-0700) Subject: Merge branch 'jh/builtin-fsmonitor-part3' X-Git-Tag: v2.37.0-rc0~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e496fffc872b20a147d7b80330335edfff919cc;p=thirdparty%2Fgit.git Merge branch 'jh/builtin-fsmonitor-part3' More fsmonitor--daemon. * jh/builtin-fsmonitor-part3: (30 commits) t7527: improve implicit shutdown testing in fsmonitor--daemon fsmonitor--daemon: allow --super-prefix argument t7527: test Unicode NFC/NFD handling on MacOS t/lib-unicode-nfc-nfd: helper prereqs for testing unicode nfc/nfd t/helper/hexdump: add helper to print hexdump of stdin fsmonitor: on macOS also emit NFC spelling for NFD pathname t7527: test FSMonitor on case insensitive+preserving file system fsmonitor: never set CE_FSMONITOR_VALID on submodules t/perf/p7527: add perf test for builtin FSMonitor t7527: FSMonitor tests for directory moves fsmonitor: optimize processing of directory events fsm-listen-darwin: shutdown daemon if worktree root is moved/renamed fsm-health-win32: force shutdown daemon if worktree root moves fsm-health-win32: add polling framework to monitor daemon health fsmonitor--daemon: stub in health thread fsmonitor--daemon: rename listener thread related variables fsmonitor--daemon: prepare for adding health thread fsmonitor--daemon: cd out of worktree root fsm-listen-darwin: ignore FSEvents caused by xattr changes on macOS unpack-trees: initialize fsmonitor_has_run_once in o->result ... --- 9e496fffc872b20a147d7b80330335edfff919cc diff --cc t/t7519-status-fsmonitor.sh index d4f9c6a837,156895f943..8348e3ae7d --- a/t/t7519-status-fsmonitor.sh +++ b/t/t7519-status-fsmonitor.sh @@@ -55,7 -55,40 +55,39 @@@ test_lazy_prereq UNTRACKED_CACHE test $ret -ne 1 ' + # Test that we detect and disallow repos that are incompatible with FSMonitor. + test_expect_success 'incompatible bare repo' ' + test_when_finished "rm -rf ./bare-clone actual expect" && + git init --bare bare-clone && + + test_must_fail \ + git -C ./bare-clone -c core.fsmonitor=foo \ + update-index --fsmonitor 2>actual && + grep "bare repository .* is incompatible with fsmonitor" actual && + + test_must_fail \ + git -C ./bare-clone -c core.fsmonitor=true \ + update-index --fsmonitor 2>actual && + grep "bare repository .* is incompatible with fsmonitor" actual + ' + + test_expect_success FSMONITOR_DAEMON 'run fsmonitor-daemon in bare repo' ' + test_when_finished "rm -rf ./bare-clone actual" && + git init --bare bare-clone && + test_must_fail git -C ./bare-clone fsmonitor--daemon run 2>actual && + grep "bare repository .* is incompatible with fsmonitor" actual + ' + + test_expect_success MINGW,FSMONITOR_DAEMON 'run fsmonitor-daemon in virtual repo' ' + test_when_finished "rm -rf ./fake-virtual-clone actual" && + git init fake-virtual-clone && + test_must_fail git -C ./fake-virtual-clone \ + -c core.virtualfilesystem=true \ + fsmonitor--daemon run 2>actual && + grep "virtual repository .* is incompatible with fsmonitor" actual + ' + test_expect_success 'setup' ' - mkdir -p .git/hooks && : >tracked && : >modified && mkdir dir1 && diff --cc unpack-trees.c index 7d73f62aee,888cff81f9..d561ca01ed --- a/unpack-trees.c +++ b/unpack-trees.c @@@ -1840,12 -1772,8 +1840,13 @@@ int unpack_trees(unsigned len, struct t o->result.fsmonitor_last_update = xstrdup_or_null(o->src_index->fsmonitor_last_update); + o->result.fsmonitor_has_run_once = o->src_index->fsmonitor_has_run_once; + if (!o->src_index->initialized && + !repo->settings.command_requires_full_index && + is_sparse_index_allowed(&o->result, 0)) + o->result.sparse_index = 1; + /* * Sparse checkout loop #1: set NEW_SKIP_WORKTREE on existing entries */