mirror of
https://github.com/git-for-windows/git.git
synced 2026-03-28 05:46:45 -05:00
fsmonitor: only enable it in non-bare repositories
The entire point of the FSMonitor is to monitor the worktree changes in a more efficient manner than `lstat()`ing all worktree files every time we refresh the index. But if there is no worktree, FSMonitor has nothing to monitor. So let's ignore if an FSMonitor is configured (e.g. in `~/.gitconfig`) and we're running in a repository without worktree. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
6
config.c
6
config.c
@@ -2519,6 +2519,12 @@ int git_config_get_max_percent_split_change(void)
|
||||
|
||||
int repo_config_get_fsmonitor(struct repository *r)
|
||||
{
|
||||
if (!r->worktree) {
|
||||
/* FSMonitor makes no sense in bare repositories */
|
||||
core_fsmonitor = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (r->settings.use_builtin_fsmonitor > 0) {
|
||||
core_fsmonitor = "(built-in daemon)";
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user