[PATCH/WIP v2 08/14] read-cache: add GIT_TEST_FORCE_WATCHER for testing
- From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
- Date
- Jan 17, 2014, 09:47 UTC
- Message-ID
- <1389952060-12297-9-git-send-email-pclouds@gmail.com>
- In-Reply-To
- <1389952060-12297-1-git-send-email-pclouds@gmail.com>
This can be used to force watcher on when running the test suite.
git-file-watcher processes are not automatically cleaned up after each test. So after running the test suite you'll be left with plenty git-file-watcher processes that should all end after about a minute.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> --- read-cache.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/read-cache.c b/read-cache.c index 5dae9eb..a1245d4 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1544,7 +1544,12 @@ static void validate_watcher(struct index_state *istate, const char *path) } if (autorun_watcher == -1) { - git_config(watcher_config, NULL); + if (getenv("GIT_TEST_FORCE_WATCHER")) { + watch_lowerlimit = 0; + recent_limit = 0; + autorun_watcher = 1; + } else + git_config(watcher_config, NULL); if (autorun_watcher == -1) autorun_watcher = 0; }
-- 1.8.5.1.208.g05b12ea