Skip to content

Commit 1d89a6b

Browse files
committed
Merge branch 'ds/fsmonitor-testing' into jch
Updates around testing fsmoitor integration. cf. <[email protected]> * ds/fsmonitor-testing: test-lib: clear watchman watches at test completion t7519: disable external GIT_TEST_FSMONITOR variable t7063: disable fsmonitor with status cache tests: disable fsmonitor in submodule tests t3030-merge-recursive.sh: disable fsmonitor when tweaking GIT_WORK_TREE t1301-shared-repo.sh: disable FSMONITOR fsmonitor: do not output to stderr for tests fsmonitor: disable in a bare repo
2 parents 9fc638a + fac4909 commit 1d89a6b

18 files changed

+54
-1
lines changed

config.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,6 +2317,11 @@ int git_config_get_max_percent_split_change(void)
23172317

23182318
int git_config_get_fsmonitor(void)
23192319
{
2320+
if (!the_repository->worktree) {
2321+
core_fsmonitor = 0;
2322+
return 0;
2323+
}
2324+
23202325
if (git_config_get_pathname("core.fsmonitor", &core_fsmonitor))
23212326
core_fsmonitor = getenv("GIT_TEST_FSMONITOR");
23222327

t/t1301-shared-repo.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
128128
'
129129

130130
test_expect_success POSIXPERM 'forced modes' '
131+
GIT_TEST_FSMONITOR="" &&
131132
mkdir -p templates/hooks &&
132133
echo update-server-info >templates/hooks/post-update &&
133134
chmod +x templates/hooks/post-update &&

t/t1510-repo-setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,7 @@ test_expect_success '#29: setup' '
775775
setup_repo 29 non-existent gitfile true &&
776776
mkdir -p 29/sub/sub 29/wt/sub &&
777777
(
778+
GIT_TEST_FSMONITOR="" &&
778779
cd 29 &&
779780
GIT_WORK_TREE="$here/29" &&
780781
export GIT_WORK_TREE &&

t/t2400-worktree-add.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
GIT_TEST_FSMONITOR=""
4+
35
test_description='test git worktree add'
46

57
. ./test-lib.sh

t/t3030-merge-recursive.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ test_expect_success 'reset and bind merge' '
548548

549549
test_expect_success 'merge-recursive w/ empty work tree - ours has rename' '
550550
(
551+
GIT_TEST_FSMONITOR="" &&
551552
GIT_WORK_TREE="$PWD/ours-has-rename-work" &&
552553
export GIT_WORK_TREE &&
553554
GIT_INDEX_FILE="$PWD/ours-has-rename-index" &&
@@ -573,6 +574,7 @@ test_expect_success 'merge-recursive w/ empty work tree - ours has rename' '
573574

574575
test_expect_success 'merge-recursive w/ empty work tree - theirs has rename' '
575576
(
577+
GIT_TEST_FSMONITOR="" &&
576578
GIT_WORK_TREE="$PWD/theirs-has-rename-work" &&
577579
export GIT_WORK_TREE &&
578580
GIT_INDEX_FILE="$PWD/theirs-has-rename-index" &&

t/t3404-rebase-interactive.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,7 @@ test_expect_success 'do "noop" when there is nothing to cherry-pick' '
743743
'
744744

745745
test_expect_success 'submodule rebase setup' '
746+
GIT_TEST_FSMONITOR="" &&
746747
git checkout A &&
747748
mkdir sub &&
748749
(

t/t3600-rm.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ test_expect_success 'rm succeeds when given a directory with a trailing /' '
360360
'
361361

362362
test_expect_success 'rm of a populated submodule with different HEAD fails unless forced' '
363+
GIT_TEST_FSMONITOR="" &&
363364
git reset --hard &&
364365
git submodule update &&
365366
git -C submod checkout HEAD^ &&

t/t4060-diff-submodule-option-diff-format.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ This test tries to verify the sanity of --submodule=diff option of git diff.
1515
# Tested non-UTF-8 encoding
1616
test_encoding="ISO8859-1"
1717

18+
# fsmonitor does not work well with submodules
19+
GIT_TEST_FSMONITOR=""
20+
1821
# String "added" in German (translated with Google Translate), encoded in UTF-8,
1922
# used in sample commit log messages in add_file() function below.
2023
added=$(printf "hinzugef\303\274gt")

t/t5526-fetch-submodules.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/sh
22
# Copyright (c) 2010, Jens Lehmann
33

4+
GIT_TEST_FSMONITOR=""
5+
46
test_description='Recursive "git fetch" for submodules'
57

68
. ./test-lib.sh

t/t7063-status-untracked-cache.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ test_description='test untracked cache'
44

55
. ./test-lib.sh
66

7+
# fsmonitor changes the expected behvaior of GIT_TRACE_UNTRACKED_STATS
8+
GIT_TEST_FSMONITOR=""
9+
710
# On some filesystems (e.g. FreeBSD's ext2 and ufs) directory mtime
811
# is updated lazily after contents in the directory changes, which
912
# forces the untracked cache code to take the slow path. A test

0 commit comments

Comments
 (0)