Thread (36 messages) 36 messages, 4 authors, 2020-01-23
STALE2341d
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH v2 1/8] fsmonitor: disable in a bare repo

From: Derrick Stolee via GitGitGadget <hidden>
Date: 2019-12-09 16:10:09
Subsystem: the rest · Maintainer: Linus Torvalds

From: Derrick Stolee <redacted>

The fsmonitor feature allows an external tool such as watchman to
monitor the working directory. The direct test
t7619-status-fsmonitor.sh provides some coverage, but it would be
better to run the entire test suite with watchman enabled. This
would provide more confidence that the feature is working as
intended.

If the repository is bare, then there is no working directory to
watch. Disable the core_fsmonitor global in this case.

Before this change, the test t0003-attributes.sh would fail with
GIT_TEST_FSMONITOR pointing to t/t7519/fsmonitor-watchman.

Signed-off-by: Derrick Stolee <redacted>
---
 config.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/config.c b/config.c
index 3900e4947b..f6d4e2fae3 100644
--- a/config.c
+++ b/config.c
@@ -2339,6 +2339,11 @@ int git_config_get_max_percent_split_change(void)
 
 int git_config_get_fsmonitor(void)
 {
+	if (!the_repository->worktree) {
+		core_fsmonitor = 0;
+		return 0;
+	}
+
 	if (git_config_get_pathname("core.fsmonitor", &core_fsmonitor))
 		core_fsmonitor = getenv("GIT_TEST_FSMONITOR");
 
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help