fix: skip file watching if not in git repo

This commit is contained in:
Nate 2025-08-20 23:13:45 -07:00
parent ff6cb91880
commit 5576497e64

View file

@ -98,6 +98,15 @@ export class FileIndexService extends BaseService<FileIndexServiceState> {
return;
}
// Only enable file watching in git repositories
// Outside git repos (like home directory), file watching causes performance issues
// and provides little value since files change less predictably
const inGitRepo = isGitRepo();
if (!inGitRepo) {
console.log("Skipping file watcher: not in a git repository");
return;
}
this.fileWatcherInitialized = true;
const watcher = getFileWatcher();