@gitkraken/core-gitlens 0.64.0 → 0.64.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.64.1] - 2026-12-03
10
+
11
+ ### Fixed
12
+
13
+ - Restores ordinary working-tree watching when the active provider rejects a delegated Git ignore refresh, including when a newer change invalidates the refresh inputs ([#6473](https://github.com/gitkraken/vscode-gitlens/issues/6473)).
14
+
15
+ ### Changed
16
+
17
+ - Includes the common Git directory's config file in `configWatchPaths` for standard and linked checkouts. Providers can observe effective config changes when the repository config is a symlink and its target changes outside the metadata watch.
18
+
9
19
  ## [0.64.0] - 2026-12-03
10
20
 
11
21
  ### Added
@@ -1586,7 +1596,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1586
1596
 
1587
1597
  - Initial release. Bundles `@gitlens/utils`, `@gitlens/git`, `@gitlens/git-cli`, `@gitlens/ai`, and `@gitlens/git-github` into a single core npm package with subpath exports.
1588
1598
 
1589
- [unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.64.0...core
1599
+ [unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.64.1...core
1600
+ [0.64.1]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.64.0..releases/core/v0.64.1
1590
1601
  [0.64.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.63.0..releases/core/v0.64.0
1591
1602
  [0.63.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.62.0..releases/core/v0.63.0
1592
1603
  [0.62.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.61.1..releases/core/v0.62.0
@@ -23,7 +23,7 @@ export type GitIgnoreRefreshReason = 'initial' | 'worktree' | 'metadata' | 'reco
23
23
  export interface GitIgnoreWatchInputs {
24
24
  readonly infoExcludePath: string;
25
25
  readonly excludesFilePath: string | null;
26
- /** Absolute system and global Git config candidates, including missing files. An empty array confirms none apply. */
26
+ /** Absolute system, global, and shared repository Git config candidates, including missing files. */
27
27
  readonly configWatchPaths?: readonly string[];
28
28
  readonly ignoreCase: boolean;
29
29
  /** Checkout-relative directories, with `/` separators and no trailing slash. Fixed exclusions take precedence. */
@@ -833,7 +833,12 @@ var RepositoryWatchService = class {
833
833
  this.relinquishIgnoreDelegation(entry);
834
834
  return;
835
835
  }
836
- await delegation.watcher.refreshGitIgnores(reason, inputs);
836
+ try {
837
+ await delegation.watcher.refreshGitIgnores(reason, inputs);
838
+ } catch {
839
+ if (entry.delegation === delegation && this.wtWatchers.get(repoPath) === entry) this.relinquishIgnoreDelegation(entry);
840
+ return;
841
+ }
837
842
  if (entry.delegation !== delegation || this.wtWatchers.get(repoPath) !== entry) return;
838
843
  if (initial) {
839
844
  delegation.initialApplied = true;
@@ -1 +1 @@
1
- {"version":3,"file":"watchService.js","names":[],"sources":["../../../../git/src/watching/watchService.ts"],"sourcesContent":["import type { UnifiedDisposable } from '@gitlens/utils/disposable.js';\nimport type { Event } from '@gitlens/utils/event.js';\nimport { Emitter } from '@gitlens/utils/event.js';\nimport { isDescendant, relative } from '@gitlens/utils/path.js';\nimport { isLinux, isWindows } from '@gitlens/utils/platform.js';\nimport type { ResourceUsage } from '@gitlens/utils/resourceUsage.js';\nimport { getRepositoryKey } from '@gitlens/utils/uri.js';\nimport type { GitDir, RepositoryChange } from '../models/repository.js';\nimport type { WatcherRepoChangeEvent } from './changeEvent.js';\nimport type { PollTarget } from './gitDirPoller.js';\nimport { GitDirPoller } from './gitDirPoller.js';\nimport type { GitIgnoreFilter } from './gitIgnoreFilter.js';\nimport type {\n\tFileWatcher,\n\tFileWatcherOptions,\n\tFileWatcherReliability,\n\tFileWatchEvent,\n\tFileWatchingProvider,\n\tGitIgnoreRefreshReason,\n\tGitIgnoreWatchInputs,\n\tGitIgnoringFileWatcher,\n} from './provider.js';\nimport { createWorkingTreeNoiseFilter, workingTreeExcludes } from './watcherPatterns.js';\nimport type { WatchGroupHooks } from './watchGroup.js';\nimport { WatchGroup } from './watchGroup.js';\nimport { RepositoryWatchSession } from './watchSession.js';\n\n/**\n * Cap on paths held while the gitignore filter loads. Higher than the session's own cap because these are\n * pre-filter — most of a build's output is typically gitignored and would be discarded on replay, so a\n * tighter bound here would mark batches incomplete when they filter down to almost nothing.\n */\nconst maxBufferedWorkingTreePaths = 5000;\n\nconst maxIgnoreCheckPaths = 1000;\nconst ignoreCheckDelayMs = 100;\n\ntype IgnorePathChecker = (paths: readonly string[], cancellation: AbortSignal) => Promise<ReadonlySet<string>>;\n\ninterface IgnoreCheckBatch {\n\treadonly check: IgnorePathChecker;\n\tpaths: Map<string, { relativePath: string; deleted: boolean }>;\n\ttimer?: ReturnType<typeof setTimeout>;\n\tcontroller?: AbortController;\n\tincomplete: boolean;\n}\n\nconst ignorePruningRefreshDelayMs = 500;\n\ninterface GitIgnoreDelegation {\n\treadonly watcher: GitIgnoringFileWatcher;\n\tinitialApplied: boolean;\n\trefreshing: boolean;\n\tverified: boolean;\n\tpendingRefresh?: Exclude<GitIgnoreRefreshReason, 'initial'>;\n}\n\ninterface CreatedWorkingTreeWatcher {\n\treadonly watcher: FileWatcher;\n\treadonly reliability: FileWatcherReliability;\n\treadonly awaitingStartAck: boolean;\n\treadonly delegation?: GitIgnoreDelegation;\n}\n\ninterface WorkingTreeWatcherEntry {\n\treadonly session: RepositoryWatchSession;\n\t/** The event handler shared by every watcher this entry has had — a re-created watcher reuses it */\n\treadonly onEvent: (event: FileWatchEvent) => void;\n\treadonly ignoreCheck?: IgnoreCheckBatch;\n\treadonly filter?: GitIgnoreFilter;\n\twatcher: FileWatcher | undefined;\n\tdelegation?: GitIgnoreDelegation;\n\t/** The git-ignored directories the live watcher was created excluding (on top of the static set) */\n\tignoredDirectories: readonly string[];\n\t/** Bumped by every ignore-rule change and by stopping; a read that lands under a different value is stale */\n\tgeneration: number;\n\treading: boolean;\n\t/** A refresh came due while a read was in flight */\n\trereadQueued: boolean;\n\trefreshTimer?: ReturnType<typeof setTimeout>;\n\t/** What the live watcher last reported; a re-created watcher starts over from its own report */\n\treliability: FileWatcherReliability;\n\tstarting: boolean;\n\tawaitingStartAck: boolean;\n\t/** Compares the host's working-tree fingerprint while the watcher isn't `reliable` */\n\tpollTarget?: PollTarget;\n\t/**\n\t * Git-ignored directories (repo-relative) whose events reached the post-filter, so the watcher isn't pruning them —\n\t * typically created after the last read (a first build's `dist/`). Each waits for a read that started after it.\n\t */\n\tunpruned?: Set<string>;\n\t/**\n\t * Directories a read showed git won't prune (they hold tracked files, or glob metacharacters in their names);\n\t * cleared when ignore rules change\n\t */\n\tunprunable?: Set<string>;\n}\n\n/**\n * A host whose watchers can report they can't be trusted (see `FileWatcherOptions.onDidChangeReliability`) passes\n * these to have core poll in their place. A `.git` directory is polled by statting the files its watchers read and\n * feeding each one that moved through the same interpretation as a watcher event; a working tree is never walked.\n */\nexport interface WatchPollingOptions {\n\t/**\n\t * Reads a path's modification time (ms) and size; `undefined` when it doesn't exist. A rejection means unknown:\n\t * the last reading stands, so it never counts as a change.\n\t */\n\treadonly stat: (path: string) => Promise<{ readonly mtime: number; readonly size: number } | undefined>;\n\t/** Whether a poll is worth running now. Default: the service isn't suspended (`suspendAll`/`resumeAll`) */\n\treadonly isActive?: () => boolean;\n\t/** How often each untrusted watcher is polled. Default: 60000ms */\n\treadonly intervalMs?: number;\n\t/**\n\t * How often `isActive` is looked at, which bounds how late the first poll after it turns true can be. Only with\n\t * `isActive`: the default gate wakes only for a poll. Default: 5000ms\n\t */\n\treadonly activeCheckMs?: number;\n\t/**\n\t * Refs to poll for a repository beyond its subscribers' `relevantRefs`: one with none (a host listing every branch)\n\t * still needs its checked-out branch's upstream, which a push moves without writing `FETCH_HEAD`\n\t */\n\treadonly getRefs?: (repoPath: string) => Iterable<string>;\n\t/**\n\t * Something that changes whenever the repository's working tree does (e.g. a digest of its status and the\n\t * changed files' stats), compared at each poll while working-tree subscribers are watching a working tree whose\n\t * watcher can't be trusted; a change is reported with no paths. `undefined` or a rejection skips that poll. With or\n\t * without it, a working tree whose watcher is `unwatchable` is reported changed (no paths) whenever its index or\n\t * `HEAD` changes.\n\t */\n\treadonly getWorkingTreeFingerprint?: (repoPath: string) => Promise<string | undefined>;\n}\n\nexport interface WatchServiceOptions {\n\treadonly watchingProvider: FileWatchingProvider;\n\t/** Default debounce for repo changes when subscriber doesn't specify. Default: 250ms */\n\treadonly defaultRepoDelayMs?: number;\n\t/** Default debounce for working tree changes when subscriber doesn't specify. Default: 2500ms */\n\treadonly defaultWorkingTreeDelayMs?: number;\n\t/** Default cap on how long continuous repo activity can defer a flush. `Infinity` disables it. Default: 2000ms */\n\treadonly defaultRepoMaxWaitMs?: number;\n\t/** Default cap on how long continuous working tree activity can defer a flush. `Infinity` disables it. Default: 10000ms */\n\treadonly defaultWorkingTreeMaxWaitMs?: number;\n\t/** Returns a GitIgnoreFilter for a given repo. When absent or returns undefined, gitignore filtering is skipped. */\n\treadonly getIgnoreFilter?: (repoPath: string, gitDirPath: string) => GitIgnoreFilter | undefined;\n\t/**\n\t * Confirms rule matches against the checkout's current Git index when processing a batch of events.\n\t * A provider can prune ahead of the checker when it preserves indexed paths under live metadata coverage.\n\t */\n\treadonly getIgnorePathChecker?: (repoPath: string) => IgnorePathChecker | undefined;\n\t/**\n\t * Returns repo-relative ignored directories for legacy native exclude pruning (`supportsExcludes`).\n\t * A rejection keeps the existing excludes.\n\t */\n\treadonly getIgnoredDirectories?: (repoPath: string) => Promise<readonly string[]>;\n\t/** Inputs for a provider-managed watch. Undefined or a rejection selects ordinary watching. */\n\treadonly getGitIgnoreWatchInputs?: (\n\t\trepoPath: string,\n\t\tgitDir: GitDir,\n\t\toptions?: { refreshConfig?: boolean },\n\t) => Promise<GitIgnoreWatchInputs | undefined>;\n\t/**\n\t * Returns the absolute, normalized folders whose worktrees are ignored (see `GitProvider.getIgnoredWorktreeRoots`):\n\t * with a `readFile` and a `readDirectory`, the watcher's reports of their admin entries reach no session. Asked\n\t * once per common git dir, when its first session starts watching, and never without both. When absent, empty or\n\t * rejected, no admin entry is read.\n\t */\n\treadonly getIgnoredWorktreeRoots?: (repoPath: string) => Promise<readonly string[]>;\n\t/**\n\t * Returns the folders whose worktrees are ignored, relative to a repository's common git dir (see\n\t * `GitProvider.getIgnoredWorktreeFolders`): the `.git` watchers whose tree holds the common git dir leave\n\t * them unwatched. Asked once per common git dir, when its first session starts watching.\n\t */\n\treadonly getIgnoredWorktreeFolders?: (repoPath: string) => readonly string[];\n\t/** Opts into polling the watchers that report they can't be trusted. Metadata coverage for tracked-path protection is independent of polling. */\n\treadonly polling?: WatchPollingOptions;\n\t/**\n\t * Reads a file's bytes; a rejection means it couldn't be read. With it, each report of a repository's shared\n\t * `.git/config` is classified by what changed in the file: a change confined to some branches' `branch.<name>`\n\t * sections reaches only the subscribers following those branches, and carries no `remotes`. Without it, every\n\t * config change concerns everyone, as before.\n\t */\n\treadonly readFile?: (path: string) => Promise<Uint8Array>;\n\t/**\n\t * Returns a directory's entries with their types, as the host file system's `readDirectory` does; only the\n\t * directories count as admin entries (a stray `.DS_Store` is no worktree's). A rejection means it couldn't be\n\t * listed, and one whose `code` is `ENOENT` or `FileNotFound` that the directory isn't there. With it and a\n\t * `readFile`, the admin entries of a repository's worktrees are listed and read once as its first session starts\n\t * watching, so the reports of an ignored worktree's (see `getIgnoredWorktreeRoots`) reach no session, and the others\n\t * aren't held back.\n\t */\n\treadonly readDirectory?: (path: string) => Promise<readonly (readonly [string, number])[]>;\n}\n\nexport interface WatchHooks {\n\t/** Called when FETCH_HEAD changed (for last-fetched tracking) */\n\treadonly onFetchHeadChanged?: (repoPath: string) => void;\n\t/** Called when .git/info/exclude changed */\n\treadonly onIgnoresChanged?: (repoPath: string) => void;\n\t/** Called when .gitignore changed in the working tree (extension watches this separately) */\n\treadonly onGitIgnoreChanged?: (repoPath: string) => void;\n}\n\nexport interface WatchHandle {\n\treadonly session: RepositoryWatchSession;\n\tdispose(): void;\n}\n\ninterface SessionRecord {\n\treadonly session: RepositoryWatchSession;\n\treadonly gitDir: GitDir;\n\t/**\n\t * Hooks contributed by all current `watch()` callers for this repo path. Earlier\n\t * implementations stored just the first caller's hooks (`WatchHooks | undefined`) and\n\t * silently dropped subsequent callers' hooks — that broke the case where a low-level\n\t * subscriber (e.g. the Graph's secondary-worktree WIP watcher) opened the session\n\t * first without hooks, and a later `Repository.watch()` for the same path lost\n\t * its `markFetched` / `onIgnoresChanged` wiring. Each `watch()` call adds its hooks\n\t * to this set and removes them on dispose; fire sites iterate the set.\n\t */\n\treadonly watchHooks: Set<WatchHooks>;\n\trefCount: number;\n\t/** The mode {@link RepositoryWatchService.onDidChangeWatchMode} last announced; `'events'` while unwatched */\n\twatchMode: 'events' | 'poll';\n}\n\n/**\n * Global service that multiplexes repository watching across all repos.\n *\n * Manages:\n * - Session map: one `RepositoryWatchSession` per repo path (ref-counted)\n * - Watch groups: shared `.git` watchers across worktrees\n * - Working tree watchers: per-repo filesystem watchers with gitignore filtering\n *\n * Sessions and watch groups are created lazily on first `subscribe()`\n * within a session, and destroyed when the last subscriber leaves.\n */\nexport class RepositoryWatchService implements UnifiedDisposable {\n\tprivate readonly _onDidChangeRepository = new Emitter<WatcherRepoChangeEvent>();\n\t/** Global multiplexed event for ALL watched repos */\n\tget onDidChangeRepository(): Event<WatcherRepoChangeEvent> {\n\t\treturn this._onDidChangeRepository.event;\n\t}\n\n\tprivate readonly _onDidChangeWorkingTree = new Emitter<string>();\n\t/** Global multiplexed working-tree change event (repo path) for ALL watched repos. Fires once per\n\t * debounced flush per session — the single point that drives the cache's status clock for working-tree edits. */\n\tget onDidChangeWorkingTree(): Event<string> {\n\t\treturn this._onDidChangeWorkingTree.event;\n\t}\n\n\tprivate readonly _onDidChangeFetchHead = new Emitter<string>();\n\t/**\n\t * Global FETCH_HEAD change event (repo path) for ALL watched repos, fired as each change is seen (no debounce).\n\t * FETCH_HEAD maps to no {@link RepositoryChange} on the session, so this is how a host invalidates its cached\n\t * last-fetched time — the standalone service bridges it to the cache's `lastFetched`.\n\t */\n\tget onDidChangeFetchHead(): Event<string> {\n\t\treturn this._onDidChangeFetchHead.event;\n\t}\n\n\tprivate readonly _onDidChangeWatchMode = new Emitter<{ repoPath: string; mode: 'events' | 'poll' }>();\n\t/**\n\t * Fires as a watched repository starts being polled in place of a watcher (see {@link getWatchMode}), and with\n\t * `'events'` as it is watched natively again. Never fires as the repository stops being watched; one watched again\n\t * later starts from `'events'`.\n\t */\n\tget onDidChangeWatchMode(): Event<{ repoPath: string; mode: 'events' | 'poll' }> {\n\t\treturn this._onDidChangeWatchMode.event;\n\t}\n\n\tprivate readonly _onDidChangeRepoWatched = new Emitter<{ repoPath: string; watched: boolean }>();\n\t/**\n\t * Fires as a repository's `.git` directory starts being watched (its session's first repo subscriber connected it\n\t * to its watch group) and as it stops (its last one left, or its session was disposed); see {@link isRepoWatched}.\n\t * `repoPath` is the session's key ({@link getRepositoryKey}). Never fires as the service itself is disposed, nor as\n\t * the session suspends or resumes: a suspended session still reports what it held once it resumes, so there is\n\t * nothing to hand off, and {@link isRepoWatched} answers `false` meanwhile without announcing it.\n\t */\n\tget onDidChangeRepoWatched(): Event<{ repoPath: string; watched: boolean }> {\n\t\treturn this._onDidChangeRepoWatched.event;\n\t}\n\n\tprivate readonly defaultRepoDelayMs?: number;\n\tprivate readonly defaultWorkingTreeDelayMs?: number;\n\tprivate readonly defaultRepoMaxWaitMs?: number;\n\tprivate readonly defaultWorkingTreeMaxWaitMs?: number;\n\tprivate readonly getIgnoreFilter?: (repoPath: string, gitDirPath: string) => GitIgnoreFilter | undefined;\n\tprivate readonly getIgnorePathChecker?: WatchServiceOptions['getIgnorePathChecker'];\n\tprivate readonly getIgnoredDirectories?: (repoPath: string) => Promise<readonly string[]>;\n\tprivate readonly getGitIgnoreWatchInputs?: WatchServiceOptions['getGitIgnoreWatchInputs'];\n\tprivate readonly getIgnoredWorktreeRoots?: (repoPath: string) => Promise<readonly string[]>;\n\tprivate readonly getIgnoredWorktreeFolders?: (repoPath: string) => readonly string[];\n\tprivate readonly provider: FileWatchingProvider;\n\tprivate readonly trackedPruning: boolean;\n\tprivate readonly poller: GitDirPoller | undefined;\n\tprivate readonly readFile: ((path: string) => Promise<Uint8Array>) | undefined;\n\tprivate readonly readDirectory: ((path: string) => Promise<readonly (readonly [string, number])[]>) | undefined;\n\n\tprivate readonly sessionMap = new Map<string, SessionRecord>();\n\tprivate readonly watchGroups = new Map<string, WatchGroup>();\n\tprivate readonly wtWatchers = new Map<string, WorkingTreeWatcherEntry>();\n\t/**\n\t * The last git-ignored directory read under each filter's current rules, kept across a working-tree watcher's\n\t * stop and start so a restart can skip the read; dropped with the filter\n\t */\n\tprivate readonly keptIgnoredDirectories = new WeakMap<GitIgnoreFilter, readonly string[]>();\n\tprivate _disposed = false;\n\t/** Global suspend state (driven by window focus); inherited by sessions created via {@link watch}. */\n\tprivate _suspended = false;\n\n\tconstructor(options: WatchServiceOptions) {\n\t\tthis.provider = options.watchingProvider;\n\t\tthis.trackedPruning = this.provider.supportsTrackedGitIgnorePaths === true;\n\t\tthis.defaultRepoDelayMs = options.defaultRepoDelayMs;\n\t\tthis.defaultWorkingTreeDelayMs = options.defaultWorkingTreeDelayMs;\n\t\tthis.defaultRepoMaxWaitMs = options.defaultRepoMaxWaitMs;\n\t\tthis.defaultWorkingTreeMaxWaitMs = options.defaultWorkingTreeMaxWaitMs;\n\t\tthis.getIgnoreFilter = options.getIgnoreFilter;\n\t\tthis.getIgnorePathChecker = options.getIgnorePathChecker;\n\t\tthis.getIgnoredDirectories = options.getIgnoredDirectories;\n\t\tthis.getGitIgnoreWatchInputs = options.getGitIgnoreWatchInputs;\n\t\tthis.getIgnoredWorktreeRoots = options.getIgnoredWorktreeRoots;\n\t\tthis.getIgnoredWorktreeFolders = options.getIgnoredWorktreeFolders;\n\t\tthis.readFile = options.readFile;\n\t\tthis.readDirectory = options.readDirectory;\n\t\tif (options.polling != null) {\n\t\t\tthis.poller = new GitDirPoller(options.polling);\n\t\t}\n\t}\n\n\t[Symbol.dispose](): void {\n\t\tthis.dispose();\n\t}\n\n\tdispose(): void {\n\t\tif (this._disposed) return;\n\n\t\tthis._disposed = true;\n\n\t\tfor (const record of this.sessionMap.values()) {\n\t\t\tthis.disposeSessionRecord(record);\n\t\t}\n\t\tthis.sessionMap.clear();\n\n\t\tfor (const group of this.watchGroups.values()) {\n\t\t\tgroup.dispose();\n\t\t}\n\t\tthis.watchGroups.clear();\n\n\t\tfor (const repoPath of [...this.wtWatchers.keys()]) {\n\t\t\tthis.stopWorkingTreeWatcher(repoPath);\n\t\t}\n\n\t\tthis.poller?.dispose();\n\n\t\tthis._onDidChangeRepository.dispose();\n\t\tthis._onDidChangeWorkingTree.dispose();\n\t\tthis._onDidChangeFetchHead.dispose();\n\t\tthis._onDidChangeWatchMode.dispose();\n\t\tthis._onDidChangeRepoWatched.dispose();\n\t}\n\n\t/**\n\t * Start watching a repository. Reference-counted:\n\t * same repoPath → same session (refCount++).\n\t * Worktrees sharing a .git dir share the WatchGroup.\n\t *\n\t * Returns a handle with the session and a dispose function.\n\t * Disposing the handle decrements the ref count.\n\t *\n\t * `repoPath` is keyed by {@link getRepositoryKey}, and every session, event and hook carries that key — the\n\t * same one the cache fences status reads on — so a host passing `C:\\repo\\` and one passing `c:/repo` share\n\t * a session and advance the same status clock.\n\t */\n\twatch(repoPath: string, gitDir: GitDir, watchHooks?: WatchHooks): WatchHandle | undefined {\n\t\tif (this._disposed) return undefined;\n\n\t\trepoPath = getRepositoryKey(repoPath);\n\n\t\tlet record = this.sessionMap.get(repoPath);\n\t\tif (record != null) {\n\t\t\trecord.refCount++;\n\t\t\tif (watchHooks != null) {\n\t\t\t\trecord.watchHooks.add(watchHooks);\n\t\t\t}\n\t\t} else {\n\t\t\tconst session = new RepositoryWatchSession({\n\t\t\t\trepoPath: repoPath,\n\t\t\t\tdefaultRepoDelayMs: this.defaultRepoDelayMs,\n\t\t\t\tdefaultWorkingTreeDelayMs: this.defaultWorkingTreeDelayMs,\n\t\t\t\tdefaultRepoMaxWaitMs: this.defaultRepoMaxWaitMs,\n\t\t\t\tdefaultWorkingTreeMaxWaitMs: this.defaultWorkingTreeMaxWaitMs,\n\t\t\t\tsuspended: this._suspended,\n\t\t\t\tlifecycle: {\n\t\t\t\t\tonFirstRepoSubscriber: (): void => {\n\t\t\t\t\t\tconst rec = this.sessionMap.get(repoPath);\n\t\t\t\t\t\tif (rec != null) {\n\t\t\t\t\t\t\tthis.connectToWatchGroup(rec);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonLastRepoSubscriber: (): void => {\n\t\t\t\t\t\tconst rec = this.sessionMap.get(repoPath);\n\t\t\t\t\t\tif (rec != null) {\n\t\t\t\t\t\t\tconst entry = this.wtWatchers.get(repoPath);\n\t\t\t\t\t\t\tif (entry?.delegation != null) {\n\t\t\t\t\t\t\t\tthis.relinquishIgnoreDelegation(entry);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.disconnectFromWatchGroup(rec);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonFirstWorkingTreeSubscriber: (): void => {\n\t\t\t\t\t\tconst rec = this.sessionMap.get(repoPath);\n\t\t\t\t\t\tif (rec != null) {\n\t\t\t\t\t\t\tthis.startWorkingTreeWatcher(rec);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonLastWorkingTreeSubscriber: (): void => {\n\t\t\t\t\t\tthis.stopWorkingTreeWatcher(repoPath);\n\t\t\t\t\t\tconst rec = this.sessionMap.get(repoPath);\n\t\t\t\t\t\tif (rec != null) {\n\t\t\t\t\t\t\tthis.updateWatchMode(rec);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tonDidFireRepoChange: (event): void => {\n\t\t\t\t\tthis._onDidChangeRepository.fire(event);\n\t\t\t\t\tconst entry = this.wtWatchers.get(repoPath);\n\t\t\t\t\tif (entry?.delegation == null || this.trackedPruning) return;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.changes.has('index') ||\n\t\t\t\t\t\tevent.changes.has('head') ||\n\t\t\t\t\t\t(event.changes.has('config') && !event.configConfined)\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.refreshWorkingTreeFilter(repoPath);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDidFireWorkingTreeChange: (repoPath): void => {\n\t\t\t\t\tthis._onDidChangeWorkingTree.fire(repoPath);\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tconst watchHooksSet = new Set<WatchHooks>();\n\t\t\tif (watchHooks != null) {\n\t\t\t\twatchHooksSet.add(watchHooks);\n\t\t\t}\n\n\t\t\trecord = {\n\t\t\t\tsession: session,\n\t\t\t\tgitDir: gitDir,\n\t\t\t\twatchHooks: watchHooksSet,\n\t\t\t\trefCount: 1,\n\t\t\t\twatchMode: 'events',\n\t\t\t};\n\t\t\tthis.sessionMap.set(repoPath, record);\n\t\t}\n\n\t\tconst sessionRef = record.session;\n\t\tlet handleDisposed = false;\n\n\t\treturn {\n\t\t\tsession: sessionRef,\n\t\t\tdispose: (): void => {\n\t\t\t\tif (handleDisposed) return;\n\n\t\t\t\thandleDisposed = true;\n\n\t\t\t\tconst rec = this.sessionMap.get(repoPath);\n\t\t\t\tif (rec == null) return;\n\n\t\t\t\trec.refCount--;\n\t\t\t\tif (watchHooks != null) {\n\t\t\t\t\trec.watchHooks.delete(watchHooks);\n\t\t\t\t}\n\t\t\t\tif (rec.refCount <= 0) {\n\t\t\t\t\tthis.sessionMap.delete(repoPath);\n\t\t\t\t\tthis.disposeSessionRecord(rec);\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Core announced one of its own writes for `repoPath`; the session watching it fires the announcement in place of\n\t * the write's own `.git` events (see {@link RepositoryWatchSession.noteSelfWrite}); `refs` are the full ref names it\n\t * moved, when it knows them, and `options.configConfinedToRefs` confines its `config` change to the sections of the\n\t * local branches among them (see `GitServiceHooks.repository.onChanged`); `options.movedWorktrees` confines its\n\t * `worktreeHead` change to those linked worktrees (see `AnnouncedRepositoryChanges.movedWorktrees`). A path no session\n\t * watches is ignored.\n\t */\n\tnoteSelfWrite(\n\t\trepoPath: string,\n\t\tchanges: readonly RepositoryChange[],\n\t\trefs?: readonly string[],\n\t\toptions?: { readonly configConfinedToRefs?: boolean; readonly movedWorktrees?: readonly string[] },\n\t): void {\n\t\tif (this._disposed) return;\n\n\t\tconst key = getRepositoryKey(repoPath);\n\t\tconst entry = this.wtWatchers.get(key);\n\t\tif (\n\t\t\tentry != null &&\n\t\t\t(entry.ignoreCheck != null || this.trackedPruning) &&\n\t\t\t(changes.length === 0 ||\n\t\t\t\tchanges.some(\n\t\t\t\t\tchange =>\n\t\t\t\t\t\tchange === 'index' ||\n\t\t\t\t\t\tchange === 'head' ||\n\t\t\t\t\t\tchange === 'config' ||\n\t\t\t\t\t\tchange === 'ignores' ||\n\t\t\t\t\t\tchange === 'unknown',\n\t\t\t\t))\n\t\t) {\n\t\t\tif (entry.delegation != null) {\n\t\t\t\tthis.refreshWorkingTreeFilter(key);\n\t\t\t} else {\n\t\t\t\tthis.invalidateIgnoreCheck(entry);\n\t\t\t}\n\t\t}\n\t\tthis.sessionMap.get(key)?.session.noteSelfWrite(changes, refs, options);\n\t}\n\n\t/**\n\t * Whether `repoPath`'s `.git` directory is watched: its session has a repo subscriber, so it is connected to its\n\t * watch group (natively, or polled in place of a watcher that can't be trusted). A session with only working-tree\n\t * subscribers, or none, doesn't count, nor does a suspended one: it holds what its watcher hears until it resumes,\n\t * and the poller doesn't poll meanwhile, so a read is served stale. Suspending or resuming announces nothing (see\n\t * {@link onDidChangeRepoWatched}).\n\t */\n\tisRepoWatched(repoPath: string): boolean {\n\t\tconst record = this.sessionMap.get(getRepositoryKey(repoPath));\n\t\treturn record != null && this.isConnected(record) && !record.session.suspended;\n\t}\n\n\t/** Get an existing session by repo path */\n\tgetSession(repoPath: string): RepositoryWatchSession | undefined {\n\t\treturn this.sessionMap.get(getRepositoryKey(repoPath))?.session;\n\t}\n\n\t/**\n\t * Whether the working tree's watch has yet to go live, owing a rescan once it does (see\n\t * `FileWatchingProvider.callsOnDidStart`). Not while it's `unwatchable`: it rescans when it comes back.\n\t */\n\tisWorkingTreeStarting(repoPath: string): boolean {\n\t\tconst entry = this.wtWatchers.get(getRepositoryKey(repoPath));\n\t\treturn entry?.starting === true && entry.reliability !== 'unwatchable';\n\t}\n\n\t/**\n\t * `'poll'` while a watcher the repository is watched through — its `.git` watchers or its working tree's — can't\n\t * watch, and is polled instead; `'events'` while it is watched natively (polled beside an `unreliable` watcher\n\t * included); `undefined` when nothing watches it, which {@link onDidChangeWatchMode} doesn't announce.\n\t */\n\tgetWatchMode(repoPath: string): 'events' | 'poll' | undefined {\n\t\tconst record = this.sessionMap.get(getRepositoryKey(repoPath));\n\t\treturn record != null ? this.computeWatchMode(record) : undefined;\n\t}\n\n\t/** Resource usage retained by repository watchers. */\n\tgetResourceUsage(): ResourceUsage {\n\t\tconst usage: ResourceUsage = {\n\t\t\t'watch.sessions.count': this.sessionMap.size,\n\t\t\t'watch.groups.count': this.watchGroups.size,\n\t\t\t'watch.workingTreeWatchers.count': this.wtWatchers.size,\n\t\t};\n\t\tif (this.poller != null) {\n\t\t\tusage['watch.pollTargets.count'] = this.poller.size;\n\t\t}\n\t\treturn usage;\n\t}\n\n\t/** Suspend all sessions and mark the service suspended so late-joining sessions start suspended */\n\tsuspendAll(): void {\n\t\tthis._suspended = true;\n\t\tfor (const record of this.sessionMap.values()) {\n\t\t\trecord.session.suspend();\n\t\t}\n\t\tfor (const entry of this.wtWatchers.values()) {\n\t\t\tthis.invalidateIgnoreCheck(entry);\n\t\t}\n\t\tthis.poller?.suspend();\n\t}\n\n\t/** Resume all sessions (clearing the global suspend state), with optional per-session delay */\n\tresumeAll(getDelay?: (session: RepositoryWatchSession) => number): void {\n\t\tthis._suspended = false;\n\t\tfor (const record of this.sessionMap.values()) {\n\t\t\tconst delayMs = getDelay?.(record.session);\n\t\t\trecord.session.resume(delayMs);\n\t\t\tconst entry = this.wtWatchers.get(record.session.repoPath);\n\t\t\tif (entry == null) continue;\n\n\t\t\tif (this.poller == null && entry.watcher == null) {\n\t\t\t\tthis.placeFallbackWorkingTreeWatcher(entry);\n\t\t\t}\n\t\t\tif (entry.ignoreCheck != null) {\n\t\t\t\tthis.scheduleIgnoreCheck(entry, entry.ignoreCheck);\n\t\t\t}\n\t\t}\n\t\tthis.poller?.resume();\n\t}\n\n\tprivate getOrCreateWatchGroup(commonGitDir: string, repoPath: string): WatchGroup {\n\t\tlet group = this.watchGroups.get(commonGitDir);\n\t\tif (group == null) {\n\t\t\tgroup = new WatchGroup(\n\t\t\t\tcommonGitDir,\n\t\t\t\tthis.provider,\n\t\t\t\tthis.poller,\n\t\t\t\tthis.readFile,\n\t\t\t\tthis.readDirectory,\n\t\t\t\t// Only a group that can read the admin entries waits on the folders; asking otherwise reads for nothing,\n\t\t\t\t// and leaves a rejection unhandled\n\t\t\t\tthis.readFile != null && this.readDirectory != null\n\t\t\t\t\t? this.getIgnoredWorktreeRoots?.(repoPath)\n\t\t\t\t\t: undefined,\n\t\t\t\tthis.getIgnoredWorktreeFolders?.(repoPath),\n\t\t\t);\n\t\t\tthis.watchGroups.set(commonGitDir, group);\n\t\t}\n\t\treturn group;\n\t}\n\n\tprivate maybeDisposeWatchGroup(commonGitDir: string): void {\n\t\tconst group = this.watchGroups.get(commonGitDir);\n\t\tif (group == null) return;\n\n\t\tif (group.sessions.size === 0) {\n\t\t\tgroup.dispose();\n\t\t\tthis.watchGroups.delete(commonGitDir);\n\t\t}\n\t}\n\n\tprivate connectToWatchGroup(record: SessionRecord): void {\n\t\tconst { session, gitDir, watchHooks } = record;\n\t\tconst commonGitDir = (gitDir.commonUri ?? gitDir.uri).fsPath;\n\t\tconst group = this.getOrCreateWatchGroup(commonGitDir, session.repoPath);\n\n\t\tconst hooks: WatchGroupHooks = {\n\t\t\tonRepoChanged: (\n\t\t\t\t_repoPath: string,\n\t\t\t\tchanges: RepositoryChange[],\n\t\t\t\tref?: string | false,\n\t\t\t\toverflow?: boolean,\n\t\t\t\tconfigBranches?: ReadonlySet<string>,\n\t\t\t\tmovedWorktree?: string,\n\t\t\t): void => {\n\t\t\t\tconst entry = this.wtWatchers.get(session.repoPath);\n\t\t\t\tconst indexMayHaveChanged = changes.includes('index') || changes.includes('head');\n\t\t\t\tif (!overflow && entry != null && (indexMayHaveChanged || changes.includes('config'))) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.trackedPruning &&\n\t\t\t\t\t\tentry.delegation != null &&\n\t\t\t\t\t\t(indexMayHaveChanged || configBranches == null)\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.refreshWorkingTreeFilter(session.repoPath);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.invalidateIgnoreCheck(entry);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (overflow) {\n\t\t\t\t\tsession.pushUnfencedRepoChanges(changes);\n\t\t\t\t} else {\n\t\t\t\t\tsession.pushRepoChanges(changes, ref, configBranches, movedWorktree);\n\t\t\t\t}\n\n\t\t\t\t// A working tree nothing watches is read again whenever the index or HEAD says it may have moved\n\t\t\t\tif (\n\t\t\t\t\tthis.poller != null &&\n\t\t\t\t\t(changes.includes('index') || changes.includes('head')) &&\n\t\t\t\t\tthis.wtWatchers.get(session.repoPath)?.reliability === 'unwatchable'\n\t\t\t\t) {\n\t\t\t\t\tsession.pushWorkingTreeChanges([], true);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonFetchHeadChanged: (repoPath: string): void => {\n\t\t\t\t// Global first, so a host's cache drops its last-fetched time before any hook re-reads it\n\t\t\t\tthis._onDidChangeFetchHead.fire(repoPath);\n\t\t\t\t// Iterate at fire time so callers that joined after the group was wired up\n\t\t\t\t// still receive events (e.g. a `Repository.watch()` whose hooks landed\n\t\t\t\t// after a hookless `GitRepositoryService.watch` registered first).\n\t\t\t\tfor (const h of watchHooks) {\n\t\t\t\t\th.onFetchHeadChanged?.(repoPath);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonIgnoresChanged: (repoPath, overflow): void => {\n\t\t\t\tthis.refreshWorkingTreeFilter(repoPath, overflow ? 'recovery' : 'metadata');\n\t\t\t\tfor (const h of watchHooks) {\n\t\t\t\t\th.onIgnoresChanged?.(repoPath);\n\t\t\t\t}\n\t\t\t},\n\t\t\tgetProbeRefs: (): Iterable<string> => {\n\t\t\t\tconst refs = session.getRelevantRefs();\n\t\t\t\tfor (const ref of this.poller?.options.getRefs?.(session.repoPath) ?? []) {\n\t\t\t\t\trefs.add(ref);\n\t\t\t\t}\n\t\t\t\treturn refs;\n\t\t\t},\n\t\t\tonMetadataCoverageChanged: live => {\n\t\t\t\tconst entry = this.wtWatchers.get(session.repoPath);\n\t\t\t\tif (entry == null || !this.trackedPruning) return;\n\n\t\t\t\tif (!live) {\n\t\t\t\t\tthis.relinquishIgnoreDelegation(entry);\n\t\t\t\t} else if (\n\t\t\t\t\tentry.delegation == null &&\n\t\t\t\t\tthis.provider.createGitIgnoringWatcher != null &&\n\t\t\t\t\tthis.getGitIgnoreWatchInputs != null\n\t\t\t\t) {\n\t\t\t\t\tthis.replaceWithCoveredWatcher(entry);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonUnwatchableChanged: (): void => this.updateWatchMode(record),\n\t\t};\n\n\t\tconst wasConnected = group.sessions.has(session.repoPath);\n\t\tgroup.addSession(session.repoPath, gitDir, hooks);\n\t\tthis.updateWatchMode(record);\n\t\tif (!wasConnected) {\n\t\t\tthis.fireRepoWatchedIfConnected(record, true);\n\t\t}\n\t}\n\n\tprivate disconnectFromWatchGroup(record: SessionRecord): void {\n\t\tconst { session, gitDir } = record;\n\t\tconst commonGitDir = (gitDir.commonUri ?? gitDir.uri).fsPath;\n\t\tconst group = this.watchGroups.get(commonGitDir);\n\t\tif (group == null) return;\n\n\t\tconst wasConnected = group.sessions.has(session.repoPath);\n\t\tgroup.removeSession(session.repoPath);\n\t\tthis.maybeDisposeWatchGroup(commonGitDir);\n\t\tthis.updateWatchMode(record);\n\t\tif (wasConnected) {\n\t\t\tthis.fireRepoWatchedIfConnected(record, false);\n\t\t}\n\t}\n\n\tprivate isConnected(record: SessionRecord): boolean {\n\t\tconst group = this.watchGroups.get((record.gitDir.commonUri ?? record.gitDir.uri).fsPath);\n\t\treturn group?.sessions.has(record.session.repoPath) ?? false;\n\t}\n\n\t/** Announces that `record` was just connected (`watched`) or disconnected, once that is what it is */\n\tprivate fireRepoWatchedIfConnected(record: SessionRecord, watched: boolean): void {\n\t\tif (this._disposed || this.isConnected(record) !== watched) return;\n\n\t\tthis._onDidChangeRepoWatched.fire({ repoPath: record.session.repoPath, watched: watched });\n\t}\n\n\tprivate computeWatchMode(record: SessionRecord): 'events' | 'poll' | undefined {\n\t\tconst repoPath = record.session.repoPath;\n\t\tconst group = this.watchGroups.get((record.gitDir.commonUri ?? record.gitDir.uri).fsPath);\n\t\tconst connected = group?.sessions.has(repoPath) ?? false;\n\t\tconst wt = this.wtWatchers.get(repoPath);\n\t\tif (!connected && wt == null) return undefined;\n\t\tif (this.poller == null && wt?.watcher == null) return connected ? 'events' : undefined;\n\n\t\treturn group?.isUnwatchable(repoPath) || wt?.reliability === 'unwatchable' ? 'poll' : 'events';\n\t}\n\n\tprivate updateWatchMode(record: SessionRecord): void {\n\t\tif (this._disposed) return;\n\n\t\tconst mode = this.computeWatchMode(record);\n\t\tif (mode == null) {\n\t\t\trecord.watchMode = 'events';\n\t\t\treturn;\n\t\t}\n\t\tif (mode === record.watchMode) return;\n\n\t\trecord.watchMode = mode;\n\t\tthis._onDidChangeWatchMode.fire({ repoPath: record.session.repoPath, mode: mode });\n\t}\n\n\tprivate startWorkingTreeWatcher(record: SessionRecord): void {\n\t\tconst { session, gitDir, watchHooks } = record;\n\t\tconst repoPath = session.repoPath;\n\t\tif (this.wtWatchers.has(repoPath)) return;\n\n\t\tconst canPrune = this.canPruneIgnoredDirectories();\n\t\tlet entry: WorkingTreeWatcherEntry | undefined;\n\n\t\tlet filter: GitIgnoreFilter | undefined;\n\t\tif (this.getIgnoreFilter != null) {\n\t\t\tfilter = this.getIgnoreFilter(repoPath, gitDir.uri.fsPath);\n\t\t}\n\n\t\tconst check = this.getIgnorePathChecker?.(repoPath);\n\t\tconst deliverUnchecked = this.trackedPruning && check == null;\n\t\tlet filterReady = filter == null || deliverUnchecked;\n\t\tlet buffered: FileWatchEvent[] | undefined = filterReady ? undefined : [];\n\t\tlet bufferIncomplete = false;\n\n\t\tconst rootPrefix = repoPath.endsWith('/') ? repoPath : `${repoPath}/`;\n\t\tconst getRelativeEventPath = (path: string): string | undefined => {\n\t\t\tif (!isWindows && path.startsWith('/') && repoPath.startsWith('/')) {\n\t\t\t\tconst prefix = path.slice(0, rootPrefix.length);\n\t\t\t\tif (prefix !== rootPrefix && (isLinux || prefix.toLowerCase() !== rootPrefix.toLowerCase())) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn path.slice(prefix.length);\n\t\t\t}\n\n\t\t\treturn isDescendant(path, repoPath) ? relative(repoPath, path) : undefined;\n\t\t};\n\t\tconst revalidated = filter?.revalidate();\n\t\tif (!filterReady && filter != null) {\n\t\t\tconst replay = (): void => {\n\t\t\t\tconst pending = buffered;\n\t\t\t\tconst incomplete = bufferIncomplete;\n\t\t\t\tfilterReady = true;\n\t\t\t\tbuffered = undefined;\n\t\t\t\tbufferIncomplete = false;\n\n\t\t\t\tif (entry == null || this.wtWatchers.get(repoPath) !== entry) return;\n\n\t\t\t\tconst deliver: string[] = [];\n\t\t\t\tfor (const event of pending ?? []) {\n\t\t\t\t\tconst relativePath = getRelativeEventPath(event.path);\n\t\t\t\t\tif (\n\t\t\t\t\t\trelativePath != null &&\n\t\t\t\t\t\tthis.shouldDeliverWorkingTreePath(entry, event.path, relativePath, event.reason === 'delete')\n\t\t\t\t\t) {\n\t\t\t\t\t\tdeliver.push(event.path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (deliver.length || incomplete) {\n\t\t\t\t\tsession.pushWorkingTreeChanges(deliver, incomplete);\n\t\t\t\t}\n\t\t\t};\n\t\t\tvoid filter\n\t\t\t\t.ready()\n\t\t\t\t.then(replay, replay)\n\t\t\t\t.catch(() => {});\n\t\t}\n\n\t\tconst onIgnoreRulesChanged = (refreshFilter: boolean, reason: 'worktree' | 'recovery' = 'worktree'): void => {\n\t\t\tif (refreshFilter && filter != null) {\n\t\t\t\tthis.reloadIgnoreFilter(filter, reason !== 'worktree' && entry?.delegation != null);\n\t\t\t}\n\t\t\tif (entry != null) {\n\t\t\t\tthis.invalidateIgnoreCheck(entry);\n\t\t\t\tthis.scheduleIgnorePruningRefresh(entry, reason);\n\t\t\t}\n\t\t\tfor (const h of watchHooks) {\n\t\t\t\th.onGitIgnoreChanged?.(repoPath);\n\t\t\t}\n\t\t\tsession.pushUnfencedRepoChanges(['ignores']);\n\t\t};\n\n\t\tconst isNoise = createWorkingTreeNoiseFilter(repoPath);\n\n\t\tconst onEvent = (event: FileWatchEvent): void => {\n\t\t\tconst startingDelegation = entry?.starting === true && entry.delegation != null;\n\t\t\tif (event.reason === 'overflow') {\n\t\t\t\tonIgnoreRulesChanged(true, 'recovery');\n\t\t\t\tif (entry?.delegation == null || !this.trackedPruning) {\n\t\t\t\t\tsession.pushWorkingTreeChanges([], true);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isNoise(event.path)) return;\n\n\t\t\tconst relativePath = getRelativeEventPath(event.path);\n\t\t\tif (relativePath === '.gitignore') {\n\t\t\t\tonIgnoreRulesChanged(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\trelativePath?.endsWith('/.gitignore') &&\n\t\t\t\t(deliverUnchecked ||\n\t\t\t\t\tentry?.delegation != null ||\n\t\t\t\t\t!(filterReady && filter?.isIgnored(relativePath.slice(0, -'.gitignore'.length))))\n\t\t\t) {\n\t\t\t\tonIgnoreRulesChanged(true);\n\t\t\t}\n\n\t\t\tif (startingDelegation) return;\n\n\t\t\tif (!filterReady) {\n\t\t\t\tif (buffered != null && buffered.length >= maxBufferedWorkingTreePaths) {\n\t\t\t\t\tbufferIncomplete = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tbuffered?.push(event);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (entry != null && this.wtWatchers.get(repoPath) !== entry) return;\n\n\t\t\tif (\n\t\t\t\tdeliverUnchecked ||\n\t\t\t\tentry == null ||\n\t\t\t\tthis.shouldDeliverWorkingTreePath(entry, event.path, relativePath, event.reason === 'delete')\n\t\t\t) {\n\t\t\t\tsession.pushWorkingTreeChanges([event.path]);\n\t\t\t}\n\t\t};\n\n\t\tconst kept = check == null && canPrune && filter != null ? this.keptIgnoredDirectories.get(filter) : undefined;\n\t\tconst eligible =\n\t\t\tthis.getGitIgnoreWatchInputs != null &&\n\t\t\t(this.trackedPruning\n\t\t\t\t? this.watchGroups.get((gitDir.commonUri ?? gitDir.uri).fsPath)?.hasLiveMetadataCoverage(repoPath)\n\t\t\t\t: check == null && this.isConnected(record));\n\t\tconst created =\n\t\t\t(eligible ? this.createWorkingTreeWatcher(repoPath, onEvent, workingTreeExcludes, true) : undefined) ??\n\t\t\tthis.createWorkingTreeWatcher(\n\t\t\t\trepoPath,\n\t\t\t\tonEvent,\n\t\t\t\tkept != null ? [...workingTreeExcludes, ...kept] : workingTreeExcludes,\n\t\t\t);\n\t\tentry = {\n\t\t\tignoreCheck: check && {\n\t\t\t\tcheck: check,\n\t\t\t\tpaths: new Map(),\n\t\t\t\tincomplete: false,\n\t\t\t},\n\t\t\tsession: session,\n\t\t\tonEvent: onEvent,\n\t\t\tfilter: filter,\n\t\t\twatcher: created.watcher,\n\t\t\tdelegation: created.delegation,\n\t\t\tignoredDirectories: created.delegation == null ? (kept ?? []) : [],\n\t\t\tgeneration: 0,\n\t\t\treading: false,\n\t\t\trereadQueued: false,\n\t\t\treliability: 'reliable',\n\t\t\tstarting: created.awaitingStartAck || created.delegation != null,\n\t\t\tawaitingStartAck: created.awaitingStartAck,\n\t\t};\n\t\tthis.wtWatchers.set(repoPath, entry);\n\t\tthis.reconcileWorkingTreeLifecycle(entry, created.reliability, { initial: true });\n\n\t\tif (entry.delegation != null || (canPrune && kept == null)) {\n\t\t\tthis.refreshIgnorePruning(entry);\n\t\t}\n\n\t\tvoid revalidated?.then(\n\t\t\tchanged => {\n\t\t\t\tif (!changed) return;\n\n\t\t\t\tif (filter != null) {\n\t\t\t\t\tthis.keptIgnoredDirectories.delete(filter);\n\t\t\t\t}\n\t\t\t\tif (this.wtWatchers.get(repoPath) === entry) {\n\t\t\t\t\tonIgnoreRulesChanged(false);\n\t\t\t\t}\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tif (filter != null) {\n\t\t\t\t\tthis.keptIgnoredDirectories.delete(filter);\n\t\t\t\t}\n\t\t\t\tif (this.wtWatchers.get(repoPath) === entry) {\n\t\t\t\t\tonIgnoreRulesChanged(true);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\t}\n\n\tprivate shouldDeliverWorkingTreePath(\n\t\tentry: WorkingTreeWatcherEntry,\n\t\tpath: string,\n\t\trelativePath: string | undefined,\n\t\tdeleted = false,\n\t): boolean {\n\t\tconst filter = entry.filter;\n\t\tif (relativePath == null || filter == null) return true;\n\n\t\tconst batch = entry.ignoreCheck;\n\t\tif (!filter.isIgnored(relativePath) && !(batch != null && filter.isIgnored(`${relativePath}/`))) return true;\n\n\t\tif (batch == null) {\n\t\t\tif (entry.delegation == null && this.canPruneIgnoredDirectories()) {\n\t\t\t\tthis.onIgnoredEvent(entry, filter, relativePath);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tif (batch.incomplete) return false;\n\n\t\tconst previous = batch.paths.get(path);\n\t\tif (this._suspended || (batch.paths.size >= maxIgnoreCheckPaths && previous == null)) {\n\t\t\tbatch.paths.clear();\n\t\t\tbatch.incomplete = true;\n\t\t} else {\n\t\t\tbatch.paths.set(path, { relativePath: relativePath, deleted: deleted || previous?.deleted === true });\n\t\t}\n\t\tthis.scheduleIgnoreCheck(entry, batch);\n\t\treturn false;\n\t}\n\n\tprivate invalidateIgnoreCheck(entry: WorkingTreeWatcherEntry): void {\n\t\tconst batch = entry.ignoreCheck;\n\t\tif (batch == null) return;\n\n\t\tif (batch.controller != null || batch.paths.size) {\n\t\t\tclearTimeout(batch.timer);\n\t\t\tbatch.timer = undefined;\n\t\t\tbatch.controller?.abort();\n\t\t\tbatch.controller = undefined;\n\t\t\tbatch.paths.clear();\n\t\t\tbatch.incomplete = true;\n\t\t}\n\t\tthis.scheduleIgnoreCheck(entry, batch);\n\t}\n\n\tprivate scheduleIgnoreCheck(entry: WorkingTreeWatcherEntry, batch: IgnoreCheckBatch): void {\n\t\tif (\n\t\t\tthis._suspended ||\n\t\t\tbatch.controller != null ||\n\t\t\tbatch.timer != null ||\n\t\t\t(!batch.paths.size && !batch.incomplete)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tbatch.timer = setTimeout(() => {\n\t\t\tbatch.timer = undefined;\n\t\t\tvoid this.flushIgnoreCheck(entry, batch);\n\t\t}, ignoreCheckDelayMs);\n\t}\n\n\tprivate async flushIgnoreCheck(entry: WorkingTreeWatcherEntry, batch: IgnoreCheckBatch): Promise<void> {\n\t\tif (batch.incomplete) {\n\t\t\tbatch.incomplete = false;\n\t\t\tentry.session.pushWorkingTreeChanges([], true);\n\t\t\treturn;\n\t\t}\n\n\t\tconst paths = batch.paths;\n\t\tconst generation = entry.generation;\n\t\tbatch.paths = new Map();\n\t\tconst controller = new AbortController();\n\t\tbatch.controller = controller;\n\t\tlet ignored: ReadonlySet<string> | undefined;\n\t\ttry {\n\t\t\tignored = await batch.check(\n\t\t\t\tArray.from(paths.values(), item => item.relativePath),\n\t\t\t\tcontroller.signal,\n\t\t\t);\n\t\t} catch {\n\t\t\t// KEEP: a failed index check can conceal edits to tracked files.\n\t\t}\n\t\tif (this.wtWatchers.get(entry.session.repoPath) !== entry || batch.controller !== controller) return;\n\n\t\tbatch.controller = undefined;\n\n\t\tif (ignored == null || generation !== entry.generation) {\n\t\t\tentry.session.pushWorkingTreeChanges([], true);\n\t\t} else {\n\t\t\tconst delivered: string[] = [];\n\t\t\tlet ignoredDeletion = false;\n\t\t\tfor (const [path, { relativePath, deleted }] of paths) {\n\t\t\t\tif (!ignored.has(relativePath)) {\n\t\t\t\t\tdelivered.push(path);\n\t\t\t\t} else {\n\t\t\t\t\tignoredDeletion ||= deleted;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (delivered.length || ignoredDeletion) {\n\t\t\t\tentry.session.pushWorkingTreeChanges(delivered, ignoredDeletion);\n\t\t\t}\n\t\t}\n\t\tthis.scheduleIgnoreCheck(entry, batch);\n\t}\n\n\tprivate stopWorkingTreeWatcher(repoPath: string): void {\n\t\tconst entry = this.wtWatchers.get(repoPath);\n\t\tif (entry == null) return;\n\n\t\tentry.generation++;\n\t\tclearTimeout(entry.ignoreCheck?.timer);\n\t\tentry.ignoreCheck?.controller?.abort();\n\t\tclearTimeout(entry.refreshTimer);\n\t\tentry.refreshTimer = undefined;\n\t\tthis.wtWatchers.delete(repoPath);\n\t\tentry.watcher?.dispose();\n\t\tif (entry.pollTarget != null) {\n\t\t\tthis.poller?.delete(entry.pollTarget);\n\t\t\tentry.pollTarget = undefined;\n\t\t}\n\t}\n\n\tprivate createWorkingTreeWatcher(\n\t\trepoPath: string,\n\t\tonEvent: (event: FileWatchEvent) => void,\n\t\texcludes: readonly string[],\n\t): CreatedWorkingTreeWatcher;\n\tprivate createWorkingTreeWatcher(\n\t\trepoPath: string,\n\t\tonEvent: (event: FileWatchEvent) => void,\n\t\texcludes: readonly string[],\n\t\ttryDelegation: true,\n\t): CreatedWorkingTreeWatcher | undefined;\n\tprivate createWorkingTreeWatcher(\n\t\trepoPath: string,\n\t\tonEvent: (event: FileWatchEvent) => void,\n\t\texcludes: readonly string[],\n\t\ttryDelegation = false,\n\t): CreatedWorkingTreeWatcher | undefined {\n\t\tlet watcher: FileWatcher | undefined;\n\t\tlet started = false;\n\t\tconst onDidStart = (): void => {\n\t\t\tif (started) return;\n\n\t\t\tstarted = true;\n\t\t\tconst entry = this.wtWatchers.get(repoPath);\n\t\t\tif (watcher != null && entry?.watcher === watcher) {\n\t\t\t\tentry.awaitingStartAck = false;\n\t\t\t\tthis.reconcileWorkingTreeLifecycle(entry, entry.reliability, { rescan: entry.delegation == null });\n\t\t\t\tif (this.trackedPruning && entry.delegation?.initialApplied && !entry.delegation.verified) {\n\t\t\t\t\tthis.refreshIgnorePruning(entry);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tlet reliability: FileWatcherReliability = 'reliable';\n\t\tconst onDidChangeReliability = (state: FileWatcherReliability): void => {\n\t\t\tif (watcher == null) {\n\t\t\t\treliability = state;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst entry = this.wtWatchers.get(repoPath);\n\t\t\tif (entry?.watcher === watcher) {\n\t\t\t\tthis.reconcileWorkingTreeLifecycle(entry, state);\n\t\t\t}\n\t\t};\n\t\tconst options: FileWatcherOptions = {\n\t\t\texcludes: excludes,\n\t\t\tonDidStart: onDidStart,\n\t\t\t...(this.poller != null || this.trackedPruning\n\t\t\t\t? { onDidChangeReliability: onDidChangeReliability }\n\t\t\t\t: undefined),\n\t\t};\n\t\tconst emit = (event: FileWatchEvent): void => {\n\t\t\tif (watcher == null ? !tryDelegation : this.wtWatchers.get(repoPath)?.watcher === watcher) {\n\t\t\t\tonEvent(event);\n\t\t\t}\n\t\t};\n\t\tif (tryDelegation) {\n\t\t\tconst delegated = this.provider.createGitIgnoringWatcher?.(repoPath, emit, options);\n\t\t\tif (delegated == null) return undefined;\n\n\t\t\twatcher = delegated;\n\t\t\treturn {\n\t\t\t\twatcher: watcher,\n\t\t\t\treliability: reliability,\n\t\t\t\tawaitingStartAck: (this.provider.callsOnDidStart === true || this.trackedPruning) && !started,\n\t\t\t\tdelegation: { watcher: delegated, initialApplied: false, refreshing: false, verified: false },\n\t\t\t};\n\t\t}\n\n\t\twatcher = this.provider.createWatcher(repoPath, '**', emit, options);\n\t\treturn {\n\t\t\twatcher: watcher,\n\t\t\treliability: reliability,\n\t\t\tawaitingStartAck: this.provider.callsOnDidStart === true && !started,\n\t\t};\n\t}\n\n\tprivate replaceWithCoveredWatcher(entry: WorkingTreeWatcherEntry): void {\n\t\tconst previous = entry.watcher;\n\t\tlet created: CreatedWorkingTreeWatcher | undefined;\n\t\ttry {\n\t\t\tcreated = this.createWorkingTreeWatcher(entry.session.repoPath, entry.onEvent, workingTreeExcludes, true);\n\t\t\tif (created == null) return;\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\n\t\tentry.watcher = created.watcher;\n\t\tentry.delegation = created.delegation;\n\t\tentry.awaitingStartAck = created.awaitingStartAck;\n\t\tentry.starting = created.awaitingStartAck || created.delegation != null;\n\t\tprevious?.dispose();\n\t\tthis.reconcileWorkingTreeLifecycle(entry, created.reliability, { initial: true, rescan: !entry.starting });\n\t\tthis.refreshIgnorePruning(entry);\n\t}\n\n\tprivate reconcileWorkingTreeLifecycle(\n\t\tentry: WorkingTreeWatcherEntry,\n\t\tstate: FileWatcherReliability,\n\t\toptions?: { initial?: boolean; rescan?: boolean },\n\t): void {\n\t\tconst unavailable = state === 'unwatchable';\n\t\tconst availabilityChanged = !options?.initial && unavailable !== (entry.reliability === 'unwatchable');\n\t\tconst delegation = entry.delegation;\n\t\tentry.reliability = state;\n\t\tif (unavailable && (delegation == null || !this.trackedPruning)) {\n\t\t\tentry.awaitingStartAck = false;\n\t\t}\n\n\t\tif (availabilityChanged && delegation != null) {\n\t\t\tif (unavailable) {\n\t\t\t\tentry.generation++;\n\t\t\t\tif (entry.starting) {\n\t\t\t\t\tdelegation.verified = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.refreshWorkingTreeFilter(entry.session.repoPath, 'recovery');\n\t\t\t}\n\t\t}\n\n\t\tconst rulesVerified = delegation?.verified !== false;\n\t\tconst startupReady = entry.starting && !unavailable && !entry.awaitingStartAck && rulesVerified;\n\t\tconst reconcileAvailability =\n\t\t\tavailabilityChanged && (unavailable || (rulesVerified && !(this.trackedPruning && delegation != null)));\n\t\tif (startupReady || (availabilityChanged && unavailable && delegation == null)) {\n\t\t\tentry.starting = false;\n\t\t}\n\n\t\tthis.updateWorkingTreePollTarget(entry);\n\t\tif (startupReady || reconcileAvailability || options?.rescan) {\n\t\t\tentry.session.pushWorkingTreeChanges([], true);\n\t\t}\n\n\t\tconst record = this.sessionMap.get(entry.session.repoPath);\n\t\tif (record != null) {\n\t\t\tthis.updateWatchMode(record);\n\t\t}\n\t}\n\n\t/** Polls the host's working-tree fingerprint, when it gives one, while the watcher isn't `reliable` */\n\tprivate updateWorkingTreePollTarget(entry: WorkingTreeWatcherEntry): void {\n\t\tconst poller = this.poller;\n\t\tconst getFingerprint = poller?.options.getWorkingTreeFingerprint;\n\t\tif (poller == null) return;\n\n\t\tif (entry.reliability === 'reliable' || (getFingerprint == null && entry.watcher != null)) {\n\t\t\tif (entry.pollTarget != null) {\n\t\t\t\tpoller.delete(entry.pollTarget);\n\t\t\t\tentry.pollTarget = undefined;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (entry.pollTarget != null) return;\n\n\t\tconst repoPath = entry.session.repoPath;\n\t\tlet last: string | undefined;\n\t\tconst target: PollTarget = {\n\t\t\tpoll: async (): Promise<void> => {\n\t\t\t\tif (entry.pollTarget !== target) return;\n\n\t\t\t\tif (entry.watcher == null) {\n\t\t\t\t\tthis.placeFallbackWorkingTreeWatcher(entry);\n\t\t\t\t}\n\t\t\t\tif (getFingerprint == null || entry.pollTarget !== target) return;\n\n\t\t\t\tlet fingerprint: string | undefined;\n\t\t\t\ttry {\n\t\t\t\t\tfingerprint = await getFingerprint(repoPath);\n\t\t\t\t} catch {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (fingerprint == null || entry.pollTarget !== target) return;\n\n\t\t\t\tconst moved = last != null && last !== fingerprint;\n\t\t\t\tlast = fingerprint;\n\t\t\t\t// A fingerprint says the tree moved, not which files did\n\t\t\t\tif (moved) {\n\t\t\t\t\tentry.session.pushWorkingTreeChanges([], true);\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t\tentry.pollTarget = target;\n\t\tpoller.add(target);\n\t}\n\n\tprivate canPruneIgnoredDirectories(): boolean {\n\t\treturn !this.trackedPruning && this.provider.supportsExcludes === true && this.getIgnoredDirectories != null;\n\t}\n\n\t/**\n\t * An event the gitignore post-filter dropped. When its directory is itself ignored, the watcher is watching an\n\t * ignored directory it could prune (one created after the last read), so the ignored set is read again. An ignored\n\t * file in a watched directory (a root `.env`, `src/debug.log`) triggers nothing.\n\t */\n\tprivate onIgnoredEvent(entry: WorkingTreeWatcherEntry, filter: GitIgnoreFilter, relativePath: string): void {\n\t\tif (entry.refreshTimer != null || entry.rereadQueued) return;\n\n\t\tlet ignoredDir: string | undefined;\n\t\tfor (let slash = relativePath.indexOf('/'); slash !== -1; slash = relativePath.indexOf('/', slash + 1)) {\n\t\t\tconst dir = relativePath.slice(0, slash);\n\t\t\tif (entry.unpruned?.has(dir) || entry.unprunable?.has(dir)) return;\n\t\t\tif (filter.isIgnored(`${dir}/`)) {\n\t\t\t\tignoredDir = dir;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (ignoredDir == null) return;\n\n\t\tentry.unpruned ??= new Set();\n\t\tentry.unpruned.add(ignoredDir);\n\n\t\tif (entry.reading) {\n\t\t\tentry.rereadQueued = true;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.armIgnorePruningRefresh(entry);\n\t}\n\n\tprivate scheduleIgnorePruningRefresh(\n\t\tentry: WorkingTreeWatcherEntry,\n\t\treason: Exclude<GitIgnoreRefreshReason, 'initial'>,\n\t): void {\n\t\tif (entry.filter != null) {\n\t\t\tthis.keptIgnoredDirectories.delete(entry.filter);\n\t\t}\n\t\tif (entry.delegation == null && (entry.ignoreCheck != null || !this.canPruneIgnoredDirectories())) return;\n\n\t\tconst delegation = entry.delegation;\n\t\tif (delegation != null) {\n\t\t\tif (entry.starting) {\n\t\t\t\tdelegation.verified = false;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tdelegation.pendingRefresh == null ||\n\t\t\t\tdelegation.pendingRefresh === 'worktree' ||\n\t\t\t\treason === 'recovery'\n\t\t\t) {\n\t\t\t\tdelegation.pendingRefresh = reason;\n\t\t\t}\n\t\t}\n\n\t\tentry.generation++;\n\t\tentry.unprunable = undefined;\n\t\tclearTimeout(entry.refreshTimer);\n\t\tthis.armIgnorePruningRefresh(entry);\n\t}\n\n\tprivate armIgnorePruningRefresh(entry: WorkingTreeWatcherEntry): void {\n\t\tentry.refreshTimer = setTimeout(() => {\n\t\t\tentry.refreshTimer = undefined;\n\t\t\tconst repoPath = entry.session.repoPath;\n\t\t\tif (this.wtWatchers.get(repoPath) !== entry) return;\n\n\t\t\tthis.refreshIgnorePruning(entry);\n\t\t}, ignorePruningRefreshDelayMs);\n\t}\n\n\tprivate refreshIgnorePruning(entry: WorkingTreeWatcherEntry): void {\n\t\tif (this.wtWatchers.get(entry.session.repoPath) !== entry) return;\n\n\t\tconst delegation = entry.delegation;\n\t\tif (delegation != null) {\n\t\t\tif (this.trackedPruning && delegation.initialApplied && entry.awaitingStartAck) return;\n\n\t\t\tif (!delegation.refreshing && (!delegation.initialApplied || entry.reliability !== 'unwatchable')) {\n\t\t\t\tvoid this.refreshDelegatedIgnores(entry, delegation);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (entry.watcher == null || entry.ignoreCheck != null || !this.canPruneIgnoredDirectories()) {\n\t\t\treturn;\n\t\t}\n\t\tif (entry.reading) {\n\t\t\tentry.rereadQueued = true;\n\t\t\treturn;\n\t\t}\n\n\t\tvoid this.refreshIgnoredDirectories(entry);\n\t}\n\n\tprivate async refreshIgnoredDirectories(entry: WorkingTreeWatcherEntry): Promise<void> {\n\t\tconst getIgnoredDirectories = this.getIgnoredDirectories;\n\t\tif (getIgnoredDirectories == null) return;\n\n\t\tentry.reading = true;\n\t\ttry {\n\t\t\tconst generation = entry.generation;\n\t\t\tconst unpruned = entry.unpruned?.size ? [...entry.unpruned] : undefined;\n\n\t\t\tlet directories: readonly string[] | undefined;\n\t\t\ttry {\n\t\t\t\tdirectories = await getIgnoredDirectories(entry.session.repoPath);\n\t\t\t} catch {\n\t\t\t\tdirectories = undefined;\n\t\t\t}\n\n\t\t\tif (entry.generation === generation) {\n\t\t\t\tif (directories != null) {\n\t\t\t\t\tthis.swapWorkingTreeWatcher(entry, directories);\n\t\t\t\t\tif (entry.filter != null) {\n\t\t\t\t\t\tthis.keptIgnoredDirectories.set(entry.filter, directories);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (unpruned != null) {\n\t\t\t\t\tthis.settleUnprunedDirectories(entry, unpruned, directories);\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tentry.reading = false;\n\n\t\t\tif (entry.rereadQueued) {\n\t\t\t\tentry.rereadQueued = false;\n\t\t\t\tif (entry.refreshTimer == null && this.wtWatchers.get(entry.session.repoPath) === entry) {\n\t\t\t\t\tthis.refreshIgnorePruning(entry);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async refreshDelegatedIgnores(\n\t\tentry: WorkingTreeWatcherEntry,\n\t\tdelegation: GitIgnoreDelegation,\n\t): Promise<void> {\n\t\tconst repoPath = entry.session.repoPath;\n\t\tconst generation = entry.generation;\n\t\tconst initial = !delegation.initialApplied;\n\t\tconst verifyingStartup = !initial && !delegation.verified;\n\t\tconst reason = initial ? 'initial' : verifyingStartup ? 'recovery' : (delegation.pendingRefresh ?? 'worktree');\n\t\tdelegation.refreshing = true;\n\n\t\ttry {\n\t\t\tconst record = this.sessionMap.get(repoPath);\n\t\t\tconst refreshConfig = verifyingStartup || (this.trackedPruning && reason !== 'worktree');\n\t\t\tconst reloadAfterRead =\n\t\t\t\trefreshConfig && (initial || verifyingStartup || !entry.filter?.canInvalidateConfig);\n\t\t\tlet inputs: GitIgnoreWatchInputs | undefined;\n\t\t\ttry {\n\t\t\t\tif (record != null) {\n\t\t\t\t\tinputs = await this.getGitIgnoreWatchInputs?.(repoPath, record.gitDir, {\n\t\t\t\t\t\trefreshConfig: reloadAfterRead,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (refreshConfig && entry.generation === generation && entry.delegation === delegation) {\n\t\t\t\t\tawait (reloadAfterRead ? entry.filter?.refresh() : entry.filter?.ready());\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (entry.generation !== generation || entry.delegation !== delegation) return;\n\t\t\tif (\n\t\t\t\tinputs == null ||\n\t\t\t\t(this.trackedPruning &&\n\t\t\t\t\t(!Array.isArray(inputs.protectedPaths) || !Array.isArray(inputs.configWatchPaths)))\n\t\t\t) {\n\t\t\t\tthis.relinquishIgnoreDelegation(entry);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tawait delegation.watcher.refreshGitIgnores(reason, inputs);\n\t\t\tif (entry.delegation !== delegation || this.wtWatchers.get(repoPath) !== entry) return;\n\t\t\tif (initial) {\n\t\t\t\tdelegation.initialApplied = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tawait entry.filter?.ready().catch(() => undefined);\n\t\t\tif (entry.generation !== generation || entry.delegation !== delegation) return;\n\n\t\t\tdelegation.verified = true;\n\t\t\tthis.reconcileWorkingTreeLifecycle(entry, entry.reliability, {\n\t\t\t\trescan: !verifyingStartup && !entry.starting,\n\t\t\t});\n\t\t} catch {\n\t\t\tif (\n\t\t\t\tentry.generation === generation &&\n\t\t\t\tthis.wtWatchers.get(repoPath) === entry &&\n\t\t\t\tentry.delegation === delegation\n\t\t\t) {\n\t\t\t\tthis.relinquishIgnoreDelegation(entry);\n\t\t\t}\n\t\t} finally {\n\t\t\tdelegation.refreshing = false;\n\t\t\tif (entry.generation === generation) {\n\t\t\t\tdelegation.pendingRefresh = undefined;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tentry.delegation === delegation &&\n\t\t\t\tthis.wtWatchers.get(repoPath) === entry &&\n\t\t\t\tentry.refreshTimer == null &&\n\t\t\t\t(delegation.pendingRefresh != null || (delegation.initialApplied && !delegation.verified))\n\t\t\t) {\n\t\t\t\tthis.refreshIgnorePruning(entry);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate relinquishIgnoreDelegation(entry: WorkingTreeWatcherEntry): void {\n\t\tconst delegation = entry.delegation;\n\t\tif (delegation == null) return;\n\n\t\tentry.delegation = undefined;\n\t\tentry.watcher = undefined;\n\t\tentry.starting = false;\n\t\tentry.awaitingStartAck = false;\n\t\tentry.generation++;\n\t\tclearTimeout(entry.refreshTimer);\n\t\tentry.refreshTimer = undefined;\n\t\tdelegation.watcher.dispose();\n\n\t\tthis.placeFallbackWorkingTreeWatcher(entry, true);\n\t}\n\n\tprivate placeFallbackWorkingTreeWatcher(entry: WorkingTreeWatcherEntry, withdrawing = false): void {\n\t\tlet created: CreatedWorkingTreeWatcher;\n\t\ttry {\n\t\t\tcreated = this.createWorkingTreeWatcher(entry.session.repoPath, entry.onEvent, workingTreeExcludes);\n\t\t} catch {\n\t\t\tthis.reconcileWorkingTreeLifecycle(entry, 'unwatchable', { initial: true, rescan: withdrawing });\n\t\t\treturn;\n\t\t}\n\n\t\tentry.watcher = created.watcher;\n\t\tentry.awaitingStartAck = created.awaitingStartAck;\n\t\tentry.starting = created.awaitingStartAck;\n\t\tthis.reconcileWorkingTreeLifecycle(entry, created.reliability, {\n\t\t\tinitial: true,\n\t\t\trescan: !entry.starting || created.reliability === 'unwatchable',\n\t\t});\n\t\tthis.refreshIgnorePruning(entry);\n\t}\n\n\t/**\n\t * A directory the read left unexcluded is one git won't prune (or the read failed), so it never triggers a read\n\t * again until ignore rules change — otherwise each of its events would spawn git.\n\t */\n\tprivate settleUnprunedDirectories(\n\t\tentry: WorkingTreeWatcherEntry,\n\t\tunpruned: readonly string[],\n\t\tdirectories: readonly string[] | undefined,\n\t): void {\n\t\tfor (const dir of unpruned) {\n\t\t\tentry.unpruned?.delete(dir);\n\t\t\tif (directories?.some(d => d === dir || dir.startsWith(`${d}/`))) continue;\n\n\t\t\tentry.unprunable ??= new Set();\n\t\t\tentry.unprunable.add(dir);\n\t\t}\n\t}\n\n\tprivate swapWorkingTreeWatcher(entry: WorkingTreeWatcherEntry, directories: readonly string[]): void {\n\t\tconst previous = entry.ignoredDirectories;\n\t\tif (previous.length === directories.length && previous.every(d => directories.includes(d))) return;\n\n\t\tlet created: CreatedWorkingTreeWatcher;\n\t\ttry {\n\t\t\tcreated = this.createWorkingTreeWatcher(entry.session.repoPath, entry.onEvent, [\n\t\t\t\t...workingTreeExcludes,\n\t\t\t\t...directories,\n\t\t\t]);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\n\t\tconst previousWatcher = entry.watcher;\n\t\tentry.watcher = created.watcher;\n\t\tentry.awaitingStartAck = created.awaitingStartAck;\n\t\tentry.starting = created.awaitingStartAck;\n\t\tentry.ignoredDirectories = directories;\n\t\tpreviousWatcher?.dispose();\n\t\tthis.reconcileWorkingTreeLifecycle(entry, created.reliability, {\n\t\t\trescan: previous.some(d => !directories.some(n => n === d || d.startsWith(`${n}/`))),\n\t\t});\n\t}\n\n\tprivate refreshWorkingTreeFilter(repoPath: string, reason: 'metadata' | 'recovery' = 'metadata'): void {\n\t\tconst entry = this.wtWatchers.get(repoPath);\n\t\tif (entry == null) return;\n\n\t\tthis.invalidateIgnoreCheck(entry);\n\t\tif (entry.filter != null) {\n\t\t\tthis.reloadIgnoreFilter(entry.filter, entry.delegation != null);\n\t\t}\n\t\tthis.scheduleIgnorePruningRefresh(entry, reason);\n\t}\n\n\tprivate reloadIgnoreFilter(filter: GitIgnoreFilter, delegatedConfigChange: boolean): void {\n\t\tconst configChanged = delegatedConfigChange && this.trackedPruning;\n\t\tif (configChanged && !filter.canInvalidateConfig) return;\n\n\t\tvoid filter.refresh({ configChanged: configChanged });\n\t}\n\n\tprivate disposeSessionRecord(record: SessionRecord): void {\n\t\t// The working tree first: with it still up, leaving the group would read as a move back to `'events'` and\n\t\t// announce one for a repository that is going away\n\t\tthis.stopWorkingTreeWatcher(record.session.repoPath);\n\t\tthis.disconnectFromWatchGroup(record);\n\t\tthis.updateWatchMode(record);\n\t\trecord.session.dispose();\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAgCA,MAAM,8BAA8B;AAEpC,MAAM,sBAAsB;AAC5B,MAAM,qBAAqB;AAY3B,MAAM,8BAA8B;;;;;;;;;;;;AA8LpC,IAAa,yBAAb,MAAiE;CAChE,yBAA0C,IAAI,QAAgC;;CAE9E,IAAI,wBAAuD;EAC1D,OAAO,KAAK,uBAAuB;CACpC;CAEA,0BAA2C,IAAI,QAAgB;;;CAG/D,IAAI,yBAAwC;EAC3C,OAAO,KAAK,wBAAwB;CACrC;CAEA,wBAAyC,IAAI,QAAgB;;;;;;CAM7D,IAAI,uBAAsC;EACzC,OAAO,KAAK,sBAAsB;CACnC;CAEA,wBAAyC,IAAI,QAAuD;;;;;;CAMpG,IAAI,uBAA6E;EAChF,OAAO,KAAK,sBAAsB;CACnC;CAEA,0BAA2C,IAAI,QAAgD;;;;;;;;CAQ/F,IAAI,yBAAwE;EAC3E,OAAO,KAAK,wBAAwB;CACrC;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,6BAA8B,IAAI,IAA2B;CAC7D,8BAA+B,IAAI,IAAwB;CAC3D,6BAA8B,IAAI,IAAqC;;;;;CAKvE,yCAA0C,IAAI,QAA4C;CAC1F,YAAoB;;CAEpB,aAAqB;CAErB,YAAY,SAA8B;EACzC,K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ACjC,MAAM,WAAW,QAAQ;EACzB,MAAM,qBAAqB;EAC3B,iBAAiB,QAAQ;EACzB,KAAK,8BAA8B,OAAO,QAAQ,aAAa,EAC9D,QAAQ,SAAS,MAAK,MAAK,CAAC,YAAY,MAAK,MAAK,MAAM,KAAK,EAAE,WAAW,GAAG,EAAE,EAAE,CAAC,CAAC,EACpF,CAAC;CACF;CAEA,yBAAiC,UAAkB,SAAkC,YAAkB;EACtG,MAAM,QAAQ,KAAK,WAAW,IAAI,QAAQ;EAC1C,IAAI,SAAS,MAAM;EAEnB,KAAK,sBAAsB,KAAK;EAChC,IAAI,MAAM,UAAU,MACnB,KAAK,mBAAmB,MAAM,QAAQ,MAAM,cAAc,IAAI;EAE/D,KAAK,6BAA6B,OAAO,MAAM;CAChD;CAEA,mBAA2B,QAAyB,uBAAsC;EACzF,MAAM,gBAAgB,yBAAyB,KAAK;EACpD,IAAI,iBAAiB,CAAC,OAAO,qBAAqB;EAElD,OAAY,QAAQ,EAAiB,cAAc,CAAC;CACrD;CAEA,qBAA6B,QAA6B;EAGzD,KAAK,uBAAuB,OAAO,QAAQ,QAAQ;EACnD,KAAK,yBAAyB,MAAM;EACpC,KAAK,gBAAgB,MAAM;EAC3B,OAAO,QAAQ,QAAQ;CACxB;AACD"}
1
+ {"version":3,"file":"watchService.js","names":[],"sources":["../../../../git/src/watching/watchService.ts"],"sourcesContent":["import type { UnifiedDisposable } from '@gitlens/utils/disposable.js';\nimport type { Event } from '@gitlens/utils/event.js';\nimport { Emitter } from '@gitlens/utils/event.js';\nimport { isDescendant, relative } from '@gitlens/utils/path.js';\nimport { isLinux, isWindows } from '@gitlens/utils/platform.js';\nimport type { ResourceUsage } from '@gitlens/utils/resourceUsage.js';\nimport { getRepositoryKey } from '@gitlens/utils/uri.js';\nimport type { GitDir, RepositoryChange } from '../models/repository.js';\nimport type { WatcherRepoChangeEvent } from './changeEvent.js';\nimport type { PollTarget } from './gitDirPoller.js';\nimport { GitDirPoller } from './gitDirPoller.js';\nimport type { GitIgnoreFilter } from './gitIgnoreFilter.js';\nimport type {\n\tFileWatcher,\n\tFileWatcherOptions,\n\tFileWatcherReliability,\n\tFileWatchEvent,\n\tFileWatchingProvider,\n\tGitIgnoreRefreshReason,\n\tGitIgnoreWatchInputs,\n\tGitIgnoringFileWatcher,\n} from './provider.js';\nimport { createWorkingTreeNoiseFilter, workingTreeExcludes } from './watcherPatterns.js';\nimport type { WatchGroupHooks } from './watchGroup.js';\nimport { WatchGroup } from './watchGroup.js';\nimport { RepositoryWatchSession } from './watchSession.js';\n\n/**\n * Cap on paths held while the gitignore filter loads. Higher than the session's own cap because these are\n * pre-filter — most of a build's output is typically gitignored and would be discarded on replay, so a\n * tighter bound here would mark batches incomplete when they filter down to almost nothing.\n */\nconst maxBufferedWorkingTreePaths = 5000;\n\nconst maxIgnoreCheckPaths = 1000;\nconst ignoreCheckDelayMs = 100;\n\ntype IgnorePathChecker = (paths: readonly string[], cancellation: AbortSignal) => Promise<ReadonlySet<string>>;\n\ninterface IgnoreCheckBatch {\n\treadonly check: IgnorePathChecker;\n\tpaths: Map<string, { relativePath: string; deleted: boolean }>;\n\ttimer?: ReturnType<typeof setTimeout>;\n\tcontroller?: AbortController;\n\tincomplete: boolean;\n}\n\nconst ignorePruningRefreshDelayMs = 500;\n\ninterface GitIgnoreDelegation {\n\treadonly watcher: GitIgnoringFileWatcher;\n\tinitialApplied: boolean;\n\trefreshing: boolean;\n\tverified: boolean;\n\tpendingRefresh?: Exclude<GitIgnoreRefreshReason, 'initial'>;\n}\n\ninterface CreatedWorkingTreeWatcher {\n\treadonly watcher: FileWatcher;\n\treadonly reliability: FileWatcherReliability;\n\treadonly awaitingStartAck: boolean;\n\treadonly delegation?: GitIgnoreDelegation;\n}\n\ninterface WorkingTreeWatcherEntry {\n\treadonly session: RepositoryWatchSession;\n\t/** The event handler shared by every watcher this entry has had — a re-created watcher reuses it */\n\treadonly onEvent: (event: FileWatchEvent) => void;\n\treadonly ignoreCheck?: IgnoreCheckBatch;\n\treadonly filter?: GitIgnoreFilter;\n\twatcher: FileWatcher | undefined;\n\tdelegation?: GitIgnoreDelegation;\n\t/** The git-ignored directories the live watcher was created excluding (on top of the static set) */\n\tignoredDirectories: readonly string[];\n\t/** Bumped by every ignore-rule change and by stopping; a read that lands under a different value is stale */\n\tgeneration: number;\n\treading: boolean;\n\t/** A refresh came due while a read was in flight */\n\trereadQueued: boolean;\n\trefreshTimer?: ReturnType<typeof setTimeout>;\n\t/** What the live watcher last reported; a re-created watcher starts over from its own report */\n\treliability: FileWatcherReliability;\n\tstarting: boolean;\n\tawaitingStartAck: boolean;\n\t/** Compares the host's working-tree fingerprint while the watcher isn't `reliable` */\n\tpollTarget?: PollTarget;\n\t/**\n\t * Git-ignored directories (repo-relative) whose events reached the post-filter, so the watcher isn't pruning them —\n\t * typically created after the last read (a first build's `dist/`). Each waits for a read that started after it.\n\t */\n\tunpruned?: Set<string>;\n\t/**\n\t * Directories a read showed git won't prune (they hold tracked files, or glob metacharacters in their names);\n\t * cleared when ignore rules change\n\t */\n\tunprunable?: Set<string>;\n}\n\n/**\n * A host whose watchers can report they can't be trusted (see `FileWatcherOptions.onDidChangeReliability`) passes\n * these to have core poll in their place. A `.git` directory is polled by statting the files its watchers read and\n * feeding each one that moved through the same interpretation as a watcher event; a working tree is never walked.\n */\nexport interface WatchPollingOptions {\n\t/**\n\t * Reads a path's modification time (ms) and size; `undefined` when it doesn't exist. A rejection means unknown:\n\t * the last reading stands, so it never counts as a change.\n\t */\n\treadonly stat: (path: string) => Promise<{ readonly mtime: number; readonly size: number } | undefined>;\n\t/** Whether a poll is worth running now. Default: the service isn't suspended (`suspendAll`/`resumeAll`) */\n\treadonly isActive?: () => boolean;\n\t/** How often each untrusted watcher is polled. Default: 60000ms */\n\treadonly intervalMs?: number;\n\t/**\n\t * How often `isActive` is looked at, which bounds how late the first poll after it turns true can be. Only with\n\t * `isActive`: the default gate wakes only for a poll. Default: 5000ms\n\t */\n\treadonly activeCheckMs?: number;\n\t/**\n\t * Refs to poll for a repository beyond its subscribers' `relevantRefs`: one with none (a host listing every branch)\n\t * still needs its checked-out branch's upstream, which a push moves without writing `FETCH_HEAD`\n\t */\n\treadonly getRefs?: (repoPath: string) => Iterable<string>;\n\t/**\n\t * Something that changes whenever the repository's working tree does (e.g. a digest of its status and the\n\t * changed files' stats), compared at each poll while working-tree subscribers are watching a working tree whose\n\t * watcher can't be trusted; a change is reported with no paths. `undefined` or a rejection skips that poll. With or\n\t * without it, a working tree whose watcher is `unwatchable` is reported changed (no paths) whenever its index or\n\t * `HEAD` changes.\n\t */\n\treadonly getWorkingTreeFingerprint?: (repoPath: string) => Promise<string | undefined>;\n}\n\nexport interface WatchServiceOptions {\n\treadonly watchingProvider: FileWatchingProvider;\n\t/** Default debounce for repo changes when subscriber doesn't specify. Default: 250ms */\n\treadonly defaultRepoDelayMs?: number;\n\t/** Default debounce for working tree changes when subscriber doesn't specify. Default: 2500ms */\n\treadonly defaultWorkingTreeDelayMs?: number;\n\t/** Default cap on how long continuous repo activity can defer a flush. `Infinity` disables it. Default: 2000ms */\n\treadonly defaultRepoMaxWaitMs?: number;\n\t/** Default cap on how long continuous working tree activity can defer a flush. `Infinity` disables it. Default: 10000ms */\n\treadonly defaultWorkingTreeMaxWaitMs?: number;\n\t/** Returns a GitIgnoreFilter for a given repo. When absent or returns undefined, gitignore filtering is skipped. */\n\treadonly getIgnoreFilter?: (repoPath: string, gitDirPath: string) => GitIgnoreFilter | undefined;\n\t/**\n\t * Confirms rule matches against the checkout's current Git index when processing a batch of events.\n\t * A provider can prune ahead of the checker when it preserves indexed paths under live metadata coverage.\n\t */\n\treadonly getIgnorePathChecker?: (repoPath: string) => IgnorePathChecker | undefined;\n\t/**\n\t * Returns repo-relative ignored directories for legacy native exclude pruning (`supportsExcludes`).\n\t * A rejection keeps the existing excludes.\n\t */\n\treadonly getIgnoredDirectories?: (repoPath: string) => Promise<readonly string[]>;\n\t/** Inputs for a provider-managed watch. Undefined or a rejection selects ordinary watching. */\n\treadonly getGitIgnoreWatchInputs?: (\n\t\trepoPath: string,\n\t\tgitDir: GitDir,\n\t\toptions?: { refreshConfig?: boolean },\n\t) => Promise<GitIgnoreWatchInputs | undefined>;\n\t/**\n\t * Returns the absolute, normalized folders whose worktrees are ignored (see `GitProvider.getIgnoredWorktreeRoots`):\n\t * with a `readFile` and a `readDirectory`, the watcher's reports of their admin entries reach no session. Asked\n\t * once per common git dir, when its first session starts watching, and never without both. When absent, empty or\n\t * rejected, no admin entry is read.\n\t */\n\treadonly getIgnoredWorktreeRoots?: (repoPath: string) => Promise<readonly string[]>;\n\t/**\n\t * Returns the folders whose worktrees are ignored, relative to a repository's common git dir (see\n\t * `GitProvider.getIgnoredWorktreeFolders`): the `.git` watchers whose tree holds the common git dir leave\n\t * them unwatched. Asked once per common git dir, when its first session starts watching.\n\t */\n\treadonly getIgnoredWorktreeFolders?: (repoPath: string) => readonly string[];\n\t/** Opts into polling the watchers that report they can't be trusted. Metadata coverage for tracked-path protection is independent of polling. */\n\treadonly polling?: WatchPollingOptions;\n\t/**\n\t * Reads a file's bytes; a rejection means it couldn't be read. With it, each report of a repository's shared\n\t * `.git/config` is classified by what changed in the file: a change confined to some branches' `branch.<name>`\n\t * sections reaches only the subscribers following those branches, and carries no `remotes`. Without it, every\n\t * config change concerns everyone, as before.\n\t */\n\treadonly readFile?: (path: string) => Promise<Uint8Array>;\n\t/**\n\t * Returns a directory's entries with their types, as the host file system's `readDirectory` does; only the\n\t * directories count as admin entries (a stray `.DS_Store` is no worktree's). A rejection means it couldn't be\n\t * listed, and one whose `code` is `ENOENT` or `FileNotFound` that the directory isn't there. With it and a\n\t * `readFile`, the admin entries of a repository's worktrees are listed and read once as its first session starts\n\t * watching, so the reports of an ignored worktree's (see `getIgnoredWorktreeRoots`) reach no session, and the others\n\t * aren't held back.\n\t */\n\treadonly readDirectory?: (path: string) => Promise<readonly (readonly [string, number])[]>;\n}\n\nexport interface WatchHooks {\n\t/** Called when FETCH_HEAD changed (for last-fetched tracking) */\n\treadonly onFetchHeadChanged?: (repoPath: string) => void;\n\t/** Called when .git/info/exclude changed */\n\treadonly onIgnoresChanged?: (repoPath: string) => void;\n\t/** Called when .gitignore changed in the working tree (extension watches this separately) */\n\treadonly onGitIgnoreChanged?: (repoPath: string) => void;\n}\n\nexport interface WatchHandle {\n\treadonly session: RepositoryWatchSession;\n\tdispose(): void;\n}\n\ninterface SessionRecord {\n\treadonly session: RepositoryWatchSession;\n\treadonly gitDir: GitDir;\n\t/**\n\t * Hooks contributed by all current `watch()` callers for this repo path. Earlier\n\t * implementations stored just the first caller's hooks (`WatchHooks | undefined`) and\n\t * silently dropped subsequent callers' hooks — that broke the case where a low-level\n\t * subscriber (e.g. the Graph's secondary-worktree WIP watcher) opened the session\n\t * first without hooks, and a later `Repository.watch()` for the same path lost\n\t * its `markFetched` / `onIgnoresChanged` wiring. Each `watch()` call adds its hooks\n\t * to this set and removes them on dispose; fire sites iterate the set.\n\t */\n\treadonly watchHooks: Set<WatchHooks>;\n\trefCount: number;\n\t/** The mode {@link RepositoryWatchService.onDidChangeWatchMode} last announced; `'events'` while unwatched */\n\twatchMode: 'events' | 'poll';\n}\n\n/**\n * Global service that multiplexes repository watching across all repos.\n *\n * Manages:\n * - Session map: one `RepositoryWatchSession` per repo path (ref-counted)\n * - Watch groups: shared `.git` watchers across worktrees\n * - Working tree watchers: per-repo filesystem watchers with gitignore filtering\n *\n * Sessions and watch groups are created lazily on first `subscribe()`\n * within a session, and destroyed when the last subscriber leaves.\n */\nexport class RepositoryWatchService implements UnifiedDisposable {\n\tprivate readonly _onDidChangeRepository = new Emitter<WatcherRepoChangeEvent>();\n\t/** Global multiplexed event for ALL watched repos */\n\tget onDidChangeRepository(): Event<WatcherRepoChangeEvent> {\n\t\treturn this._onDidChangeRepository.event;\n\t}\n\n\tprivate readonly _onDidChangeWorkingTree = new Emitter<string>();\n\t/** Global multiplexed working-tree change event (repo path) for ALL watched repos. Fires once per\n\t * debounced flush per session — the single point that drives the cache's status clock for working-tree edits. */\n\tget onDidChangeWorkingTree(): Event<string> {\n\t\treturn this._onDidChangeWorkingTree.event;\n\t}\n\n\tprivate readonly _onDidChangeFetchHead = new Emitter<string>();\n\t/**\n\t * Global FETCH_HEAD change event (repo path) for ALL watched repos, fired as each change is seen (no debounce).\n\t * FETCH_HEAD maps to no {@link RepositoryChange} on the session, so this is how a host invalidates its cached\n\t * last-fetched time — the standalone service bridges it to the cache's `lastFetched`.\n\t */\n\tget onDidChangeFetchHead(): Event<string> {\n\t\treturn this._onDidChangeFetchHead.event;\n\t}\n\n\tprivate readonly _onDidChangeWatchMode = new Emitter<{ repoPath: string; mode: 'events' | 'poll' }>();\n\t/**\n\t * Fires as a watched repository starts being polled in place of a watcher (see {@link getWatchMode}), and with\n\t * `'events'` as it is watched natively again. Never fires as the repository stops being watched; one watched again\n\t * later starts from `'events'`.\n\t */\n\tget onDidChangeWatchMode(): Event<{ repoPath: string; mode: 'events' | 'poll' }> {\n\t\treturn this._onDidChangeWatchMode.event;\n\t}\n\n\tprivate readonly _onDidChangeRepoWatched = new Emitter<{ repoPath: string; watched: boolean }>();\n\t/**\n\t * Fires as a repository's `.git` directory starts being watched (its session's first repo subscriber connected it\n\t * to its watch group) and as it stops (its last one left, or its session was disposed); see {@link isRepoWatched}.\n\t * `repoPath` is the session's key ({@link getRepositoryKey}). Never fires as the service itself is disposed, nor as\n\t * the session suspends or resumes: a suspended session still reports what it held once it resumes, so there is\n\t * nothing to hand off, and {@link isRepoWatched} answers `false` meanwhile without announcing it.\n\t */\n\tget onDidChangeRepoWatched(): Event<{ repoPath: string; watched: boolean }> {\n\t\treturn this._onDidChangeRepoWatched.event;\n\t}\n\n\tprivate readonly defaultRepoDelayMs?: number;\n\tprivate readonly defaultWorkingTreeDelayMs?: number;\n\tprivate readonly defaultRepoMaxWaitMs?: number;\n\tprivate readonly defaultWorkingTreeMaxWaitMs?: number;\n\tprivate readonly getIgnoreFilter?: (repoPath: string, gitDirPath: string) => GitIgnoreFilter | undefined;\n\tprivate readonly getIgnorePathChecker?: WatchServiceOptions['getIgnorePathChecker'];\n\tprivate readonly getIgnoredDirectories?: (repoPath: string) => Promise<readonly string[]>;\n\tprivate readonly getGitIgnoreWatchInputs?: WatchServiceOptions['getGitIgnoreWatchInputs'];\n\tprivate readonly getIgnoredWorktreeRoots?: (repoPath: string) => Promise<readonly string[]>;\n\tprivate readonly getIgnoredWorktreeFolders?: (repoPath: string) => readonly string[];\n\tprivate readonly provider: FileWatchingProvider;\n\tprivate readonly trackedPruning: boolean;\n\tprivate readonly poller: GitDirPoller | undefined;\n\tprivate readonly readFile: ((path: string) => Promise<Uint8Array>) | undefined;\n\tprivate readonly readDirectory: ((path: string) => Promise<readonly (readonly [string, number])[]>) | undefined;\n\n\tprivate readonly sessionMap = new Map<string, SessionRecord>();\n\tprivate readonly watchGroups = new Map<string, WatchGroup>();\n\tprivate readonly wtWatchers = new Map<string, WorkingTreeWatcherEntry>();\n\t/**\n\t * The last git-ignored directory read under each filter's current rules, kept across a working-tree watcher's\n\t * stop and start so a restart can skip the read; dropped with the filter\n\t */\n\tprivate readonly keptIgnoredDirectories = new WeakMap<GitIgnoreFilter, readonly string[]>();\n\tprivate _disposed = false;\n\t/** Global suspend state (driven by window focus); inherited by sessions created via {@link watch}. */\n\tprivate _suspended = false;\n\n\tconstructor(options: WatchServiceOptions) {\n\t\tthis.provider = options.watchingProvider;\n\t\tthis.trackedPruning = this.provider.supportsTrackedGitIgnorePaths === true;\n\t\tthis.defaultRepoDelayMs = options.defaultRepoDelayMs;\n\t\tthis.defaultWorkingTreeDelayMs = options.defaultWorkingTreeDelayMs;\n\t\tthis.defaultRepoMaxWaitMs = options.defaultRepoMaxWaitMs;\n\t\tthis.defaultWorkingTreeMaxWaitMs = options.defaultWorkingTreeMaxWaitMs;\n\t\tthis.getIgnoreFilter = options.getIgnoreFilter;\n\t\tthis.getIgnorePathChecker = options.getIgnorePathChecker;\n\t\tthis.getIgnoredDirectories = options.getIgnoredDirectories;\n\t\tthis.getGitIgnoreWatchInputs = options.getGitIgnoreWatchInputs;\n\t\tthis.getIgnoredWorktreeRoots = options.getIgnoredWorktreeRoots;\n\t\tthis.getIgnoredWorktreeFolders = options.getIgnoredWorktreeFolders;\n\t\tthis.readFile = options.readFile;\n\t\tthis.readDirectory = options.readDirectory;\n\t\tif (options.polling != null) {\n\t\t\tthis.poller = new GitDirPoller(options.polling);\n\t\t}\n\t}\n\n\t[Symbol.dispose](): void {\n\t\tthis.dispose();\n\t}\n\n\tdispose(): void {\n\t\tif (this._disposed) return;\n\n\t\tthis._disposed = true;\n\n\t\tfor (const record of this.sessionMap.values()) {\n\t\t\tthis.disposeSessionRecord(record);\n\t\t}\n\t\tthis.sessionMap.clear();\n\n\t\tfor (const group of this.watchGroups.values()) {\n\t\t\tgroup.dispose();\n\t\t}\n\t\tthis.watchGroups.clear();\n\n\t\tfor (const repoPath of [...this.wtWatchers.keys()]) {\n\t\t\tthis.stopWorkingTreeWatcher(repoPath);\n\t\t}\n\n\t\tthis.poller?.dispose();\n\n\t\tthis._onDidChangeRepository.dispose();\n\t\tthis._onDidChangeWorkingTree.dispose();\n\t\tthis._onDidChangeFetchHead.dispose();\n\t\tthis._onDidChangeWatchMode.dispose();\n\t\tthis._onDidChangeRepoWatched.dispose();\n\t}\n\n\t/**\n\t * Start watching a repository. Reference-counted:\n\t * same repoPath → same session (refCount++).\n\t * Worktrees sharing a .git dir share the WatchGroup.\n\t *\n\t * Returns a handle with the session and a dispose function.\n\t * Disposing the handle decrements the ref count.\n\t *\n\t * `repoPath` is keyed by {@link getRepositoryKey}, and every session, event and hook carries that key — the\n\t * same one the cache fences status reads on — so a host passing `C:\\repo\\` and one passing `c:/repo` share\n\t * a session and advance the same status clock.\n\t */\n\twatch(repoPath: string, gitDir: GitDir, watchHooks?: WatchHooks): WatchHandle | undefined {\n\t\tif (this._disposed) return undefined;\n\n\t\trepoPath = getRepositoryKey(repoPath);\n\n\t\tlet record = this.sessionMap.get(repoPath);\n\t\tif (record != null) {\n\t\t\trecord.refCount++;\n\t\t\tif (watchHooks != null) {\n\t\t\t\trecord.watchHooks.add(watchHooks);\n\t\t\t}\n\t\t} else {\n\t\t\tconst session = new RepositoryWatchSession({\n\t\t\t\trepoPath: repoPath,\n\t\t\t\tdefaultRepoDelayMs: this.defaultRepoDelayMs,\n\t\t\t\tdefaultWorkingTreeDelayMs: this.defaultWorkingTreeDelayMs,\n\t\t\t\tdefaultRepoMaxWaitMs: this.defaultRepoMaxWaitMs,\n\t\t\t\tdefaultWorkingTreeMaxWaitMs: this.defaultWorkingTreeMaxWaitMs,\n\t\t\t\tsuspended: this._suspended,\n\t\t\t\tlifecycle: {\n\t\t\t\t\tonFirstRepoSubscriber: (): void => {\n\t\t\t\t\t\tconst rec = this.sessionMap.get(repoPath);\n\t\t\t\t\t\tif (rec != null) {\n\t\t\t\t\t\t\tthis.connectToWatchGroup(rec);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonLastRepoSubscriber: (): void => {\n\t\t\t\t\t\tconst rec = this.sessionMap.get(repoPath);\n\t\t\t\t\t\tif (rec != null) {\n\t\t\t\t\t\t\tconst entry = this.wtWatchers.get(repoPath);\n\t\t\t\t\t\t\tif (entry?.delegation != null) {\n\t\t\t\t\t\t\t\tthis.relinquishIgnoreDelegation(entry);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.disconnectFromWatchGroup(rec);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonFirstWorkingTreeSubscriber: (): void => {\n\t\t\t\t\t\tconst rec = this.sessionMap.get(repoPath);\n\t\t\t\t\t\tif (rec != null) {\n\t\t\t\t\t\t\tthis.startWorkingTreeWatcher(rec);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonLastWorkingTreeSubscriber: (): void => {\n\t\t\t\t\t\tthis.stopWorkingTreeWatcher(repoPath);\n\t\t\t\t\t\tconst rec = this.sessionMap.get(repoPath);\n\t\t\t\t\t\tif (rec != null) {\n\t\t\t\t\t\t\tthis.updateWatchMode(rec);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tonDidFireRepoChange: (event): void => {\n\t\t\t\t\tthis._onDidChangeRepository.fire(event);\n\t\t\t\t\tconst entry = this.wtWatchers.get(repoPath);\n\t\t\t\t\tif (entry?.delegation == null || this.trackedPruning) return;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.changes.has('index') ||\n\t\t\t\t\t\tevent.changes.has('head') ||\n\t\t\t\t\t\t(event.changes.has('config') && !event.configConfined)\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.refreshWorkingTreeFilter(repoPath);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDidFireWorkingTreeChange: (repoPath): void => {\n\t\t\t\t\tthis._onDidChangeWorkingTree.fire(repoPath);\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tconst watchHooksSet = new Set<WatchHooks>();\n\t\t\tif (watchHooks != null) {\n\t\t\t\twatchHooksSet.add(watchHooks);\n\t\t\t}\n\n\t\t\trecord = {\n\t\t\t\tsession: session,\n\t\t\t\tgitDir: gitDir,\n\t\t\t\twatchHooks: watchHooksSet,\n\t\t\t\trefCount: 1,\n\t\t\t\twatchMode: 'events',\n\t\t\t};\n\t\t\tthis.sessionMap.set(repoPath, record);\n\t\t}\n\n\t\tconst sessionRef = record.session;\n\t\tlet handleDisposed = false;\n\n\t\treturn {\n\t\t\tsession: sessionRef,\n\t\t\tdispose: (): void => {\n\t\t\t\tif (handleDisposed) return;\n\n\t\t\t\thandleDisposed = true;\n\n\t\t\t\tconst rec = this.sessionMap.get(repoPath);\n\t\t\t\tif (rec == null) return;\n\n\t\t\t\trec.refCount--;\n\t\t\t\tif (watchHooks != null) {\n\t\t\t\t\trec.watchHooks.delete(watchHooks);\n\t\t\t\t}\n\t\t\t\tif (rec.refCount <= 0) {\n\t\t\t\t\tthis.sessionMap.delete(repoPath);\n\t\t\t\t\tthis.disposeSessionRecord(rec);\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Core announced one of its own writes for `repoPath`; the session watching it fires the announcement in place of\n\t * the write's own `.git` events (see {@link RepositoryWatchSession.noteSelfWrite}); `refs` are the full ref names it\n\t * moved, when it knows them, and `options.configConfinedToRefs` confines its `config` change to the sections of the\n\t * local branches among them (see `GitServiceHooks.repository.onChanged`); `options.movedWorktrees` confines its\n\t * `worktreeHead` change to those linked worktrees (see `AnnouncedRepositoryChanges.movedWorktrees`). A path no session\n\t * watches is ignored.\n\t */\n\tnoteSelfWrite(\n\t\trepoPath: string,\n\t\tchanges: readonly RepositoryChange[],\n\t\trefs?: readonly string[],\n\t\toptions?: { readonly configConfinedToRefs?: boolean; readonly movedWorktrees?: readonly string[] },\n\t): void {\n\t\tif (this._disposed) return;\n\n\t\tconst key = getRepositoryKey(repoPath);\n\t\tconst entry = this.wtWatchers.get(key);\n\t\tif (\n\t\t\tentry != null &&\n\t\t\t(entry.ignoreCheck != null || this.trackedPruning) &&\n\t\t\t(changes.length === 0 ||\n\t\t\t\tchanges.some(\n\t\t\t\t\tchange =>\n\t\t\t\t\t\tchange === 'index' ||\n\t\t\t\t\t\tchange === 'head' ||\n\t\t\t\t\t\tchange === 'config' ||\n\t\t\t\t\t\tchange === 'ignores' ||\n\t\t\t\t\t\tchange === 'unknown',\n\t\t\t\t))\n\t\t) {\n\t\t\tif (entry.delegation != null) {\n\t\t\t\tthis.refreshWorkingTreeFilter(key);\n\t\t\t} else {\n\t\t\t\tthis.invalidateIgnoreCheck(entry);\n\t\t\t}\n\t\t}\n\t\tthis.sessionMap.get(key)?.session.noteSelfWrite(changes, refs, options);\n\t}\n\n\t/**\n\t * Whether `repoPath`'s `.git` directory is watched: its session has a repo subscriber, so it is connected to its\n\t * watch group (natively, or polled in place of a watcher that can't be trusted). A session with only working-tree\n\t * subscribers, or none, doesn't count, nor does a suspended one: it holds what its watcher hears until it resumes,\n\t * and the poller doesn't poll meanwhile, so a read is served stale. Suspending or resuming announces nothing (see\n\t * {@link onDidChangeRepoWatched}).\n\t */\n\tisRepoWatched(repoPath: string): boolean {\n\t\tconst record = this.sessionMap.get(getRepositoryKey(repoPath));\n\t\treturn record != null && this.isConnected(record) && !record.session.suspended;\n\t}\n\n\t/** Get an existing session by repo path */\n\tgetSession(repoPath: string): RepositoryWatchSession | undefined {\n\t\treturn this.sessionMap.get(getRepositoryKey(repoPath))?.session;\n\t}\n\n\t/**\n\t * Whether the working tree's watch has yet to go live, owing a rescan once it does (see\n\t * `FileWatchingProvider.callsOnDidStart`). Not while it's `unwatchable`: it rescans when it comes back.\n\t */\n\tisWorkingTreeStarting(repoPath: string): boolean {\n\t\tconst entry = this.wtWatchers.get(getRepositoryKey(repoPath));\n\t\treturn entry?.starting === true && entry.reliability !== 'unwatchable';\n\t}\n\n\t/**\n\t * `'poll'` while a watcher the repository is watched through — its `.git` watchers or its working tree's — can't\n\t * watch, and is polled instead; `'events'` while it is watched natively (polled beside an `unreliable` watcher\n\t * included); `undefined` when nothing watches it, which {@link onDidChangeWatchMode} doesn't announce.\n\t */\n\tgetWatchMode(repoPath: string): 'events' | 'poll' | undefined {\n\t\tconst record = this.sessionMap.get(getRepositoryKey(repoPath));\n\t\treturn record != null ? this.computeWatchMode(record) : undefined;\n\t}\n\n\t/** Resource usage retained by repository watchers. */\n\tgetResourceUsage(): ResourceUsage {\n\t\tconst usage: ResourceUsage = {\n\t\t\t'watch.sessions.count': this.sessionMap.size,\n\t\t\t'watch.groups.count': this.watchGroups.size,\n\t\t\t'watch.workingTreeWatchers.count': this.wtWatchers.size,\n\t\t};\n\t\tif (this.poller != null) {\n\t\t\tusage['watch.pollTargets.count'] = this.poller.size;\n\t\t}\n\t\treturn usage;\n\t}\n\n\t/** Suspend all sessions and mark the service suspended so late-joining sessions start suspended */\n\tsuspendAll(): void {\n\t\tthis._suspended = true;\n\t\tfor (const record of this.sessionMap.values()) {\n\t\t\trecord.session.suspend();\n\t\t}\n\t\tfor (const entry of this.wtWatchers.values()) {\n\t\t\tthis.invalidateIgnoreCheck(entry);\n\t\t}\n\t\tthis.poller?.suspend();\n\t}\n\n\t/** Resume all sessions (clearing the global suspend state), with optional per-session delay */\n\tresumeAll(getDelay?: (session: RepositoryWatchSession) => number): void {\n\t\tthis._suspended = false;\n\t\tfor (const record of this.sessionMap.values()) {\n\t\t\tconst delayMs = getDelay?.(record.session);\n\t\t\trecord.session.resume(delayMs);\n\t\t\tconst entry = this.wtWatchers.get(record.session.repoPath);\n\t\t\tif (entry == null) continue;\n\n\t\t\tif (this.poller == null && entry.watcher == null) {\n\t\t\t\tthis.placeFallbackWorkingTreeWatcher(entry);\n\t\t\t}\n\t\t\tif (entry.ignoreCheck != null) {\n\t\t\t\tthis.scheduleIgnoreCheck(entry, entry.ignoreCheck);\n\t\t\t}\n\t\t}\n\t\tthis.poller?.resume();\n\t}\n\n\tprivate getOrCreateWatchGroup(commonGitDir: string, repoPath: string): WatchGroup {\n\t\tlet group = this.watchGroups.get(commonGitDir);\n\t\tif (group == null) {\n\t\t\tgroup = new WatchGroup(\n\t\t\t\tcommonGitDir,\n\t\t\t\tthis.provider,\n\t\t\t\tthis.poller,\n\t\t\t\tthis.readFile,\n\t\t\t\tthis.readDirectory,\n\t\t\t\t// Only a group that can read the admin entries waits on the folders; asking otherwise reads for nothing,\n\t\t\t\t// and leaves a rejection unhandled\n\t\t\t\tthis.readFile != null && this.readDirectory != null\n\t\t\t\t\t? this.getIgnoredWorktreeRoots?.(repoPath)\n\t\t\t\t\t: undefined,\n\t\t\t\tthis.getIgnoredWorktreeFolders?.(repoPath),\n\t\t\t);\n\t\t\tthis.watchGroups.set(commonGitDir, group);\n\t\t}\n\t\treturn group;\n\t}\n\n\tprivate maybeDisposeWatchGroup(commonGitDir: string): void {\n\t\tconst group = this.watchGroups.get(commonGitDir);\n\t\tif (group == null) return;\n\n\t\tif (group.sessions.size === 0) {\n\t\t\tgroup.dispose();\n\t\t\tthis.watchGroups.delete(commonGitDir);\n\t\t}\n\t}\n\n\tprivate connectToWatchGroup(record: SessionRecord): void {\n\t\tconst { session, gitDir, watchHooks } = record;\n\t\tconst commonGitDir = (gitDir.commonUri ?? gitDir.uri).fsPath;\n\t\tconst group = this.getOrCreateWatchGroup(commonGitDir, session.repoPath);\n\n\t\tconst hooks: WatchGroupHooks = {\n\t\t\tonRepoChanged: (\n\t\t\t\t_repoPath: string,\n\t\t\t\tchanges: RepositoryChange[],\n\t\t\t\tref?: string | false,\n\t\t\t\toverflow?: boolean,\n\t\t\t\tconfigBranches?: ReadonlySet<string>,\n\t\t\t\tmovedWorktree?: string,\n\t\t\t): void => {\n\t\t\t\tconst entry = this.wtWatchers.get(session.repoPath);\n\t\t\t\tconst indexMayHaveChanged = changes.includes('index') || changes.includes('head');\n\t\t\t\tif (!overflow && entry != null && (indexMayHaveChanged || changes.includes('config'))) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.trackedPruning &&\n\t\t\t\t\t\tentry.delegation != null &&\n\t\t\t\t\t\t(indexMayHaveChanged || configBranches == null)\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.refreshWorkingTreeFilter(session.repoPath);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.invalidateIgnoreCheck(entry);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (overflow) {\n\t\t\t\t\tsession.pushUnfencedRepoChanges(changes);\n\t\t\t\t} else {\n\t\t\t\t\tsession.pushRepoChanges(changes, ref, configBranches, movedWorktree);\n\t\t\t\t}\n\n\t\t\t\t// A working tree nothing watches is read again whenever the index or HEAD says it may have moved\n\t\t\t\tif (\n\t\t\t\t\tthis.poller != null &&\n\t\t\t\t\t(changes.includes('index') || changes.includes('head')) &&\n\t\t\t\t\tthis.wtWatchers.get(session.repoPath)?.reliability === 'unwatchable'\n\t\t\t\t) {\n\t\t\t\t\tsession.pushWorkingTreeChanges([], true);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonFetchHeadChanged: (repoPath: string): void => {\n\t\t\t\t// Global first, so a host's cache drops its last-fetched time before any hook re-reads it\n\t\t\t\tthis._onDidChangeFetchHead.fire(repoPath);\n\t\t\t\t// Iterate at fire time so callers that joined after the group was wired up\n\t\t\t\t// still receive events (e.g. a `Repository.watch()` whose hooks landed\n\t\t\t\t// after a hookless `GitRepositoryService.watch` registered first).\n\t\t\t\tfor (const h of watchHooks) {\n\t\t\t\t\th.onFetchHeadChanged?.(repoPath);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonIgnoresChanged: (repoPath, overflow): void => {\n\t\t\t\tthis.refreshWorkingTreeFilter(repoPath, overflow ? 'recovery' : 'metadata');\n\t\t\t\tfor (const h of watchHooks) {\n\t\t\t\t\th.onIgnoresChanged?.(repoPath);\n\t\t\t\t}\n\t\t\t},\n\t\t\tgetProbeRefs: (): Iterable<string> => {\n\t\t\t\tconst refs = session.getRelevantRefs();\n\t\t\t\tfor (const ref of this.poller?.options.getRefs?.(session.repoPath) ?? []) {\n\t\t\t\t\trefs.add(ref);\n\t\t\t\t}\n\t\t\t\treturn refs;\n\t\t\t},\n\t\t\tonMetadataCoverageChanged: live => {\n\t\t\t\tconst entry = this.wtWatchers.get(session.repoPath);\n\t\t\t\tif (entry == null || !this.trackedPruning) return;\n\n\t\t\t\tif (!live) {\n\t\t\t\t\tthis.relinquishIgnoreDelegation(entry);\n\t\t\t\t} else if (\n\t\t\t\t\tentry.delegation == null &&\n\t\t\t\t\tthis.provider.createGitIgnoringWatcher != null &&\n\t\t\t\t\tthis.getGitIgnoreWatchInputs != null\n\t\t\t\t) {\n\t\t\t\t\tthis.replaceWithCoveredWatcher(entry);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonUnwatchableChanged: (): void => this.updateWatchMode(record),\n\t\t};\n\n\t\tconst wasConnected = group.sessions.has(session.repoPath);\n\t\tgroup.addSession(session.repoPath, gitDir, hooks);\n\t\tthis.updateWatchMode(record);\n\t\tif (!wasConnected) {\n\t\t\tthis.fireRepoWatchedIfConnected(record, true);\n\t\t}\n\t}\n\n\tprivate disconnectFromWatchGroup(record: SessionRecord): void {\n\t\tconst { session, gitDir } = record;\n\t\tconst commonGitDir = (gitDir.commonUri ?? gitDir.uri).fsPath;\n\t\tconst group = this.watchGroups.get(commonGitDir);\n\t\tif (group == null) return;\n\n\t\tconst wasConnected = group.sessions.has(session.repoPath);\n\t\tgroup.removeSession(session.repoPath);\n\t\tthis.maybeDisposeWatchGroup(commonGitDir);\n\t\tthis.updateWatchMode(record);\n\t\tif (wasConnected) {\n\t\t\tthis.fireRepoWatchedIfConnected(record, false);\n\t\t}\n\t}\n\n\tprivate isConnected(record: SessionRecord): boolean {\n\t\tconst group = this.watchGroups.get((record.gitDir.commonUri ?? record.gitDir.uri).fsPath);\n\t\treturn group?.sessions.has(record.session.repoPath) ?? false;\n\t}\n\n\t/** Announces that `record` was just connected (`watched`) or disconnected, once that is what it is */\n\tprivate fireRepoWatchedIfConnected(record: SessionRecord, watched: boolean): void {\n\t\tif (this._disposed || this.isConnected(record) !== watched) return;\n\n\t\tthis._onDidChangeRepoWatched.fire({ repoPath: record.session.repoPath, watched: watched });\n\t}\n\n\tprivate computeWatchMode(record: SessionRecord): 'events' | 'poll' | undefined {\n\t\tconst repoPath = record.session.repoPath;\n\t\tconst group = this.watchGroups.get((record.gitDir.commonUri ?? record.gitDir.uri).fsPath);\n\t\tconst connected = group?.sessions.has(repoPath) ?? false;\n\t\tconst wt = this.wtWatchers.get(repoPath);\n\t\tif (!connected && wt == null) return undefined;\n\t\tif (this.poller == null && wt?.watcher == null) return connected ? 'events' : undefined;\n\n\t\treturn group?.isUnwatchable(repoPath) || wt?.reliability === 'unwatchable' ? 'poll' : 'events';\n\t}\n\n\tprivate updateWatchMode(record: SessionRecord): void {\n\t\tif (this._disposed) return;\n\n\t\tconst mode = this.computeWatchMode(record);\n\t\tif (mode == null) {\n\t\t\trecord.watchMode = 'events';\n\t\t\treturn;\n\t\t}\n\t\tif (mode === record.watchMode) return;\n\n\t\trecord.watchMode = mode;\n\t\tthis._onDidChangeWatchMode.fire({ repoPath: record.session.repoPath, mode: mode });\n\t}\n\n\tprivate startWorkingTreeWatcher(record: SessionRecord): void {\n\t\tconst { session, gitDir, watchHooks } = record;\n\t\tconst repoPath = session.repoPath;\n\t\tif (this.wtWatchers.has(repoPath)) return;\n\n\t\tconst canPrune = this.canPruneIgnoredDirectories();\n\t\tlet entry: WorkingTreeWatcherEntry | undefined;\n\n\t\tlet filter: GitIgnoreFilter | undefined;\n\t\tif (this.getIgnoreFilter != null) {\n\t\t\tfilter = this.getIgnoreFilter(repoPath, gitDir.uri.fsPath);\n\t\t}\n\n\t\tconst check = this.getIgnorePathChecker?.(repoPath);\n\t\tconst deliverUnchecked = this.trackedPruning && check == null;\n\t\tlet filterReady = filter == null || deliverUnchecked;\n\t\tlet buffered: FileWatchEvent[] | undefined = filterReady ? undefined : [];\n\t\tlet bufferIncomplete = false;\n\n\t\tconst rootPrefix = repoPath.endsWith('/') ? repoPath : `${repoPath}/`;\n\t\tconst getRelativeEventPath = (path: string): string | undefined => {\n\t\t\tif (!isWindows && path.startsWith('/') && repoPath.startsWith('/')) {\n\t\t\t\tconst prefix = path.slice(0, rootPrefix.length);\n\t\t\t\tif (prefix !== rootPrefix && (isLinux || prefix.toLowerCase() !== rootPrefix.toLowerCase())) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn path.slice(prefix.length);\n\t\t\t}\n\n\t\t\treturn isDescendant(path, repoPath) ? relative(repoPath, path) : undefined;\n\t\t};\n\t\tconst revalidated = filter?.revalidate();\n\t\tif (!filterReady && filter != null) {\n\t\t\tconst replay = (): void => {\n\t\t\t\tconst pending = buffered;\n\t\t\t\tconst incomplete = bufferIncomplete;\n\t\t\t\tfilterReady = true;\n\t\t\t\tbuffered = undefined;\n\t\t\t\tbufferIncomplete = false;\n\n\t\t\t\tif (entry == null || this.wtWatchers.get(repoPath) !== entry) return;\n\n\t\t\t\tconst deliver: string[] = [];\n\t\t\t\tfor (const event of pending ?? []) {\n\t\t\t\t\tconst relativePath = getRelativeEventPath(event.path);\n\t\t\t\t\tif (\n\t\t\t\t\t\trelativePath != null &&\n\t\t\t\t\t\tthis.shouldDeliverWorkingTreePath(entry, event.path, relativePath, event.reason === 'delete')\n\t\t\t\t\t) {\n\t\t\t\t\t\tdeliver.push(event.path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (deliver.length || incomplete) {\n\t\t\t\t\tsession.pushWorkingTreeChanges(deliver, incomplete);\n\t\t\t\t}\n\t\t\t};\n\t\t\tvoid filter\n\t\t\t\t.ready()\n\t\t\t\t.then(replay, replay)\n\t\t\t\t.catch(() => {});\n\t\t}\n\n\t\tconst onIgnoreRulesChanged = (refreshFilter: boolean, reason: 'worktree' | 'recovery' = 'worktree'): void => {\n\t\t\tif (refreshFilter && filter != null) {\n\t\t\t\tthis.reloadIgnoreFilter(filter, reason !== 'worktree' && entry?.delegation != null);\n\t\t\t}\n\t\t\tif (entry != null) {\n\t\t\t\tthis.invalidateIgnoreCheck(entry);\n\t\t\t\tthis.scheduleIgnorePruningRefresh(entry, reason);\n\t\t\t}\n\t\t\tfor (const h of watchHooks) {\n\t\t\t\th.onGitIgnoreChanged?.(repoPath);\n\t\t\t}\n\t\t\tsession.pushUnfencedRepoChanges(['ignores']);\n\t\t};\n\n\t\tconst isNoise = createWorkingTreeNoiseFilter(repoPath);\n\n\t\tconst onEvent = (event: FileWatchEvent): void => {\n\t\t\tconst startingDelegation = entry?.starting === true && entry.delegation != null;\n\t\t\tif (event.reason === 'overflow') {\n\t\t\t\tonIgnoreRulesChanged(true, 'recovery');\n\t\t\t\tif (entry?.delegation == null || !this.trackedPruning) {\n\t\t\t\t\tsession.pushWorkingTreeChanges([], true);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (isNoise(event.path)) return;\n\n\t\t\tconst relativePath = getRelativeEventPath(event.path);\n\t\t\tif (relativePath === '.gitignore') {\n\t\t\t\tonIgnoreRulesChanged(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\trelativePath?.endsWith('/.gitignore') &&\n\t\t\t\t(deliverUnchecked ||\n\t\t\t\t\tentry?.delegation != null ||\n\t\t\t\t\t!(filterReady && filter?.isIgnored(relativePath.slice(0, -'.gitignore'.length))))\n\t\t\t) {\n\t\t\t\tonIgnoreRulesChanged(true);\n\t\t\t}\n\n\t\t\tif (startingDelegation) return;\n\n\t\t\tif (!filterReady) {\n\t\t\t\tif (buffered != null && buffered.length >= maxBufferedWorkingTreePaths) {\n\t\t\t\t\tbufferIncomplete = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tbuffered?.push(event);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (entry != null && this.wtWatchers.get(repoPath) !== entry) return;\n\n\t\t\tif (\n\t\t\t\tdeliverUnchecked ||\n\t\t\t\tentry == null ||\n\t\t\t\tthis.shouldDeliverWorkingTreePath(entry, event.path, relativePath, event.reason === 'delete')\n\t\t\t) {\n\t\t\t\tsession.pushWorkingTreeChanges([event.path]);\n\t\t\t}\n\t\t};\n\n\t\tconst kept = check == null && canPrune && filter != null ? this.keptIgnoredDirectories.get(filter) : undefined;\n\t\tconst eligible =\n\t\t\tthis.getGitIgnoreWatchInputs != null &&\n\t\t\t(this.trackedPruning\n\t\t\t\t? this.watchGroups.get((gitDir.commonUri ?? gitDir.uri).fsPath)?.hasLiveMetadataCoverage(repoPath)\n\t\t\t\t: check == null && this.isConnected(record));\n\t\tconst created =\n\t\t\t(eligible ? this.createWorkingTreeWatcher(repoPath, onEvent, workingTreeExcludes, true) : undefined) ??\n\t\t\tthis.createWorkingTreeWatcher(\n\t\t\t\trepoPath,\n\t\t\t\tonEvent,\n\t\t\t\tkept != null ? [...workingTreeExcludes, ...kept] : workingTreeExcludes,\n\t\t\t);\n\t\tentry = {\n\t\t\tignoreCheck: check && {\n\t\t\t\tcheck: check,\n\t\t\t\tpaths: new Map(),\n\t\t\t\tincomplete: false,\n\t\t\t},\n\t\t\tsession: session,\n\t\t\tonEvent: onEvent,\n\t\t\tfilter: filter,\n\t\t\twatcher: created.watcher,\n\t\t\tdelegation: created.delegation,\n\t\t\tignoredDirectories: created.delegation == null ? (kept ?? []) : [],\n\t\t\tgeneration: 0,\n\t\t\treading: false,\n\t\t\trereadQueued: false,\n\t\t\treliability: 'reliable',\n\t\t\tstarting: created.awaitingStartAck || created.delegation != null,\n\t\t\tawaitingStartAck: created.awaitingStartAck,\n\t\t};\n\t\tthis.wtWatchers.set(repoPath, entry);\n\t\tthis.reconcileWorkingTreeLifecycle(entry, created.reliability, { initial: true });\n\n\t\tif (entry.delegation != null || (canPrune && kept == null)) {\n\t\t\tthis.refreshIgnorePruning(entry);\n\t\t}\n\n\t\tvoid revalidated?.then(\n\t\t\tchanged => {\n\t\t\t\tif (!changed) return;\n\n\t\t\t\tif (filter != null) {\n\t\t\t\t\tthis.keptIgnoredDirectories.delete(filter);\n\t\t\t\t}\n\t\t\t\tif (this.wtWatchers.get(repoPath) === entry) {\n\t\t\t\t\tonIgnoreRulesChanged(false);\n\t\t\t\t}\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tif (filter != null) {\n\t\t\t\t\tthis.keptIgnoredDirectories.delete(filter);\n\t\t\t\t}\n\t\t\t\tif (this.wtWatchers.get(repoPath) === entry) {\n\t\t\t\t\tonIgnoreRulesChanged(true);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\t}\n\n\tprivate shouldDeliverWorkingTreePath(\n\t\tentry: WorkingTreeWatcherEntry,\n\t\tpath: string,\n\t\trelativePath: string | undefined,\n\t\tdeleted = false,\n\t): boolean {\n\t\tconst filter = entry.filter;\n\t\tif (relativePath == null || filter == null) return true;\n\n\t\tconst batch = entry.ignoreCheck;\n\t\tif (!filter.isIgnored(relativePath) && !(batch != null && filter.isIgnored(`${relativePath}/`))) return true;\n\n\t\tif (batch == null) {\n\t\t\tif (entry.delegation == null && this.canPruneIgnoredDirectories()) {\n\t\t\t\tthis.onIgnoredEvent(entry, filter, relativePath);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tif (batch.incomplete) return false;\n\n\t\tconst previous = batch.paths.get(path);\n\t\tif (this._suspended || (batch.paths.size >= maxIgnoreCheckPaths && previous == null)) {\n\t\t\tbatch.paths.clear();\n\t\t\tbatch.incomplete = true;\n\t\t} else {\n\t\t\tbatch.paths.set(path, { relativePath: relativePath, deleted: deleted || previous?.deleted === true });\n\t\t}\n\t\tthis.scheduleIgnoreCheck(entry, batch);\n\t\treturn false;\n\t}\n\n\tprivate invalidateIgnoreCheck(entry: WorkingTreeWatcherEntry): void {\n\t\tconst batch = entry.ignoreCheck;\n\t\tif (batch == null) return;\n\n\t\tif (batch.controller != null || batch.paths.size) {\n\t\t\tclearTimeout(batch.timer);\n\t\t\tbatch.timer = undefined;\n\t\t\tbatch.controller?.abort();\n\t\t\tbatch.controller = undefined;\n\t\t\tbatch.paths.clear();\n\t\t\tbatch.incomplete = true;\n\t\t}\n\t\tthis.scheduleIgnoreCheck(entry, batch);\n\t}\n\n\tprivate scheduleIgnoreCheck(entry: WorkingTreeWatcherEntry, batch: IgnoreCheckBatch): void {\n\t\tif (\n\t\t\tthis._suspended ||\n\t\t\tbatch.controller != null ||\n\t\t\tbatch.timer != null ||\n\t\t\t(!batch.paths.size && !batch.incomplete)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tbatch.timer = setTimeout(() => {\n\t\t\tbatch.timer = undefined;\n\t\t\tvoid this.flushIgnoreCheck(entry, batch);\n\t\t}, ignoreCheckDelayMs);\n\t}\n\n\tprivate async flushIgnoreCheck(entry: WorkingTreeWatcherEntry, batch: IgnoreCheckBatch): Promise<void> {\n\t\tif (batch.incomplete) {\n\t\t\tbatch.incomplete = false;\n\t\t\tentry.session.pushWorkingTreeChanges([], true);\n\t\t\treturn;\n\t\t}\n\n\t\tconst paths = batch.paths;\n\t\tconst generation = entry.generation;\n\t\tbatch.paths = new Map();\n\t\tconst controller = new AbortController();\n\t\tbatch.controller = controller;\n\t\tlet ignored: ReadonlySet<string> | undefined;\n\t\ttry {\n\t\t\tignored = await batch.check(\n\t\t\t\tArray.from(paths.values(), item => item.relativePath),\n\t\t\t\tcontroller.signal,\n\t\t\t);\n\t\t} catch {\n\t\t\t// KEEP: a failed index check can conceal edits to tracked files.\n\t\t}\n\t\tif (this.wtWatchers.get(entry.session.repoPath) !== entry || batch.controller !== controller) return;\n\n\t\tbatch.controller = undefined;\n\n\t\tif (ignored == null || generation !== entry.generation) {\n\t\t\tentry.session.pushWorkingTreeChanges([], true);\n\t\t} else {\n\t\t\tconst delivered: string[] = [];\n\t\t\tlet ignoredDeletion = false;\n\t\t\tfor (const [path, { relativePath, deleted }] of paths) {\n\t\t\t\tif (!ignored.has(relativePath)) {\n\t\t\t\t\tdelivered.push(path);\n\t\t\t\t} else {\n\t\t\t\t\tignoredDeletion ||= deleted;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (delivered.length || ignoredDeletion) {\n\t\t\t\tentry.session.pushWorkingTreeChanges(delivered, ignoredDeletion);\n\t\t\t}\n\t\t}\n\t\tthis.scheduleIgnoreCheck(entry, batch);\n\t}\n\n\tprivate stopWorkingTreeWatcher(repoPath: string): void {\n\t\tconst entry = this.wtWatchers.get(repoPath);\n\t\tif (entry == null) return;\n\n\t\tentry.generation++;\n\t\tclearTimeout(entry.ignoreCheck?.timer);\n\t\tentry.ignoreCheck?.controller?.abort();\n\t\tclearTimeout(entry.refreshTimer);\n\t\tentry.refreshTimer = undefined;\n\t\tthis.wtWatchers.delete(repoPath);\n\t\tentry.watcher?.dispose();\n\t\tif (entry.pollTarget != null) {\n\t\t\tthis.poller?.delete(entry.pollTarget);\n\t\t\tentry.pollTarget = undefined;\n\t\t}\n\t}\n\n\tprivate createWorkingTreeWatcher(\n\t\trepoPath: string,\n\t\tonEvent: (event: FileWatchEvent) => void,\n\t\texcludes: readonly string[],\n\t): CreatedWorkingTreeWatcher;\n\tprivate createWorkingTreeWatcher(\n\t\trepoPath: string,\n\t\tonEvent: (event: FileWatchEvent) => void,\n\t\texcludes: readonly string[],\n\t\ttryDelegation: true,\n\t): CreatedWorkingTreeWatcher | undefined;\n\tprivate createWorkingTreeWatcher(\n\t\trepoPath: string,\n\t\tonEvent: (event: FileWatchEvent) => void,\n\t\texcludes: readonly string[],\n\t\ttryDelegation = false,\n\t): CreatedWorkingTreeWatcher | undefined {\n\t\tlet watcher: FileWatcher | undefined;\n\t\tlet started = false;\n\t\tconst onDidStart = (): void => {\n\t\t\tif (started) return;\n\n\t\t\tstarted = true;\n\t\t\tconst entry = this.wtWatchers.get(repoPath);\n\t\t\tif (watcher != null && entry?.watcher === watcher) {\n\t\t\t\tentry.awaitingStartAck = false;\n\t\t\t\tthis.reconcileWorkingTreeLifecycle(entry, entry.reliability, { rescan: entry.delegation == null });\n\t\t\t\tif (this.trackedPruning && entry.delegation?.initialApplied && !entry.delegation.verified) {\n\t\t\t\t\tthis.refreshIgnorePruning(entry);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tlet reliability: FileWatcherReliability = 'reliable';\n\t\tconst onDidChangeReliability = (state: FileWatcherReliability): void => {\n\t\t\tif (watcher == null) {\n\t\t\t\treliability = state;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst entry = this.wtWatchers.get(repoPath);\n\t\t\tif (entry?.watcher === watcher) {\n\t\t\t\tthis.reconcileWorkingTreeLifecycle(entry, state);\n\t\t\t}\n\t\t};\n\t\tconst options: FileWatcherOptions = {\n\t\t\texcludes: excludes,\n\t\t\tonDidStart: onDidStart,\n\t\t\t...(this.poller != null || this.trackedPruning\n\t\t\t\t? { onDidChangeReliability: onDidChangeReliability }\n\t\t\t\t: undefined),\n\t\t};\n\t\tconst emit = (event: FileWatchEvent): void => {\n\t\t\tif (watcher == null ? !tryDelegation : this.wtWatchers.get(repoPath)?.watcher === watcher) {\n\t\t\t\tonEvent(event);\n\t\t\t}\n\t\t};\n\t\tif (tryDelegation) {\n\t\t\tconst delegated = this.provider.createGitIgnoringWatcher?.(repoPath, emit, options);\n\t\t\tif (delegated == null) return undefined;\n\n\t\t\twatcher = delegated;\n\t\t\treturn {\n\t\t\t\twatcher: watcher,\n\t\t\t\treliability: reliability,\n\t\t\t\tawaitingStartAck: (this.provider.callsOnDidStart === true || this.trackedPruning) && !started,\n\t\t\t\tdelegation: { watcher: delegated, initialApplied: false, refreshing: false, verified: false },\n\t\t\t};\n\t\t}\n\n\t\twatcher = this.provider.createWatcher(repoPath, '**', emit, options);\n\t\treturn {\n\t\t\twatcher: watcher,\n\t\t\treliability: reliability,\n\t\t\tawaitingStartAck: this.provider.callsOnDidStart === true && !started,\n\t\t};\n\t}\n\n\tprivate replaceWithCoveredWatcher(entry: WorkingTreeWatcherEntry): void {\n\t\tconst previous = entry.watcher;\n\t\tlet created: CreatedWorkingTreeWatcher | undefined;\n\t\ttry {\n\t\t\tcreated = this.createWorkingTreeWatcher(entry.session.repoPath, entry.onEvent, workingTreeExcludes, true);\n\t\t\tif (created == null) return;\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\n\t\tentry.watcher = created.watcher;\n\t\tentry.delegation = created.delegation;\n\t\tentry.awaitingStartAck = created.awaitingStartAck;\n\t\tentry.starting = created.awaitingStartAck || created.delegation != null;\n\t\tprevious?.dispose();\n\t\tthis.reconcileWorkingTreeLifecycle(entry, created.reliability, { initial: true, rescan: !entry.starting });\n\t\tthis.refreshIgnorePruning(entry);\n\t}\n\n\tprivate reconcileWorkingTreeLifecycle(\n\t\tentry: WorkingTreeWatcherEntry,\n\t\tstate: FileWatcherReliability,\n\t\toptions?: { initial?: boolean; rescan?: boolean },\n\t): void {\n\t\tconst unavailable = state === 'unwatchable';\n\t\tconst availabilityChanged = !options?.initial && unavailable !== (entry.reliability === 'unwatchable');\n\t\tconst delegation = entry.delegation;\n\t\tentry.reliability = state;\n\t\tif (unavailable && (delegation == null || !this.trackedPruning)) {\n\t\t\tentry.awaitingStartAck = false;\n\t\t}\n\n\t\tif (availabilityChanged && delegation != null) {\n\t\t\tif (unavailable) {\n\t\t\t\tentry.generation++;\n\t\t\t\tif (entry.starting) {\n\t\t\t\t\tdelegation.verified = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.refreshWorkingTreeFilter(entry.session.repoPath, 'recovery');\n\t\t\t}\n\t\t}\n\n\t\tconst rulesVerified = delegation?.verified !== false;\n\t\tconst startupReady = entry.starting && !unavailable && !entry.awaitingStartAck && rulesVerified;\n\t\tconst reconcileAvailability =\n\t\t\tavailabilityChanged && (unavailable || (rulesVerified && !(this.trackedPruning && delegation != null)));\n\t\tif (startupReady || (availabilityChanged && unavailable && delegation == null)) {\n\t\t\tentry.starting = false;\n\t\t}\n\n\t\tthis.updateWorkingTreePollTarget(entry);\n\t\tif (startupReady || reconcileAvailability || options?.rescan) {\n\t\t\tentry.session.pushWorkingTreeChanges([], true);\n\t\t}\n\n\t\tconst record = this.sessionMap.get(entry.session.repoPath);\n\t\tif (record != null) {\n\t\t\tthis.updateWatchMode(record);\n\t\t}\n\t}\n\n\t/** Polls the host's working-tree fingerprint, when it gives one, while the watcher isn't `reliable` */\n\tprivate updateWorkingTreePollTarget(entry: WorkingTreeWatcherEntry): void {\n\t\tconst poller = this.poller;\n\t\tconst getFingerprint = poller?.options.getWorkingTreeFingerprint;\n\t\tif (poller == null) return;\n\n\t\tif (entry.reliability === 'reliable' || (getFingerprint == null && entry.watcher != null)) {\n\t\t\tif (entry.pollTarget != null) {\n\t\t\t\tpoller.delete(entry.pollTarget);\n\t\t\t\tentry.pollTarget = undefined;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (entry.pollTarget != null) return;\n\n\t\tconst repoPath = entry.session.repoPath;\n\t\tlet last: string | undefined;\n\t\tconst target: PollTarget = {\n\t\t\tpoll: async (): Promise<void> => {\n\t\t\t\tif (entry.pollTarget !== target) return;\n\n\t\t\t\tif (entry.watcher == null) {\n\t\t\t\t\tthis.placeFallbackWorkingTreeWatcher(entry);\n\t\t\t\t}\n\t\t\t\tif (getFingerprint == null || entry.pollTarget !== target) return;\n\n\t\t\t\tlet fingerprint: string | undefined;\n\t\t\t\ttry {\n\t\t\t\t\tfingerprint = await getFingerprint(repoPath);\n\t\t\t\t} catch {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (fingerprint == null || entry.pollTarget !== target) return;\n\n\t\t\t\tconst moved = last != null && last !== fingerprint;\n\t\t\t\tlast = fingerprint;\n\t\t\t\t// A fingerprint says the tree moved, not which files did\n\t\t\t\tif (moved) {\n\t\t\t\t\tentry.session.pushWorkingTreeChanges([], true);\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t\tentry.pollTarget = target;\n\t\tpoller.add(target);\n\t}\n\n\tprivate canPruneIgnoredDirectories(): boolean {\n\t\treturn !this.trackedPruning && this.provider.supportsExcludes === true && this.getIgnoredDirectories != null;\n\t}\n\n\t/**\n\t * An event the gitignore post-filter dropped. When its directory is itself ignored, the watcher is watching an\n\t * ignored directory it could prune (one created after the last read), so the ignored set is read again. An ignored\n\t * file in a watched directory (a root `.env`, `src/debug.log`) triggers nothing.\n\t */\n\tprivate onIgnoredEvent(entry: WorkingTreeWatcherEntry, filter: GitIgnoreFilter, relativePath: string): void {\n\t\tif (entry.refreshTimer != null || entry.rereadQueued) return;\n\n\t\tlet ignoredDir: string | undefined;\n\t\tfor (let slash = relativePath.indexOf('/'); slash !== -1; slash = relativePath.indexOf('/', slash + 1)) {\n\t\t\tconst dir = relativePath.slice(0, slash);\n\t\t\tif (entry.unpruned?.has(dir) || entry.unprunable?.has(dir)) return;\n\t\t\tif (filter.isIgnored(`${dir}/`)) {\n\t\t\t\tignoredDir = dir;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (ignoredDir == null) return;\n\n\t\tentry.unpruned ??= new Set();\n\t\tentry.unpruned.add(ignoredDir);\n\n\t\tif (entry.reading) {\n\t\t\tentry.rereadQueued = true;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.armIgnorePruningRefresh(entry);\n\t}\n\n\tprivate scheduleIgnorePruningRefresh(\n\t\tentry: WorkingTreeWatcherEntry,\n\t\treason: Exclude<GitIgnoreRefreshReason, 'initial'>,\n\t): void {\n\t\tif (entry.filter != null) {\n\t\t\tthis.keptIgnoredDirectories.delete(entry.filter);\n\t\t}\n\t\tif (entry.delegation == null && (entry.ignoreCheck != null || !this.canPruneIgnoredDirectories())) return;\n\n\t\tconst delegation = entry.delegation;\n\t\tif (delegation != null) {\n\t\t\tif (entry.starting) {\n\t\t\t\tdelegation.verified = false;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tdelegation.pendingRefresh == null ||\n\t\t\t\tdelegation.pendingRefresh === 'worktree' ||\n\t\t\t\treason === 'recovery'\n\t\t\t) {\n\t\t\t\tdelegation.pendingRefresh = reason;\n\t\t\t}\n\t\t}\n\n\t\tentry.generation++;\n\t\tentry.unprunable = undefined;\n\t\tclearTimeout(entry.refreshTimer);\n\t\tthis.armIgnorePruningRefresh(entry);\n\t}\n\n\tprivate armIgnorePruningRefresh(entry: WorkingTreeWatcherEntry): void {\n\t\tentry.refreshTimer = setTimeout(() => {\n\t\t\tentry.refreshTimer = undefined;\n\t\t\tconst repoPath = entry.session.repoPath;\n\t\t\tif (this.wtWatchers.get(repoPath) !== entry) return;\n\n\t\t\tthis.refreshIgnorePruning(entry);\n\t\t}, ignorePruningRefreshDelayMs);\n\t}\n\n\tprivate refreshIgnorePruning(entry: WorkingTreeWatcherEntry): void {\n\t\tif (this.wtWatchers.get(entry.session.repoPath) !== entry) return;\n\n\t\tconst delegation = entry.delegation;\n\t\tif (delegation != null) {\n\t\t\tif (this.trackedPruning && delegation.initialApplied && entry.awaitingStartAck) return;\n\n\t\t\tif (!delegation.refreshing && (!delegation.initialApplied || entry.reliability !== 'unwatchable')) {\n\t\t\t\tvoid this.refreshDelegatedIgnores(entry, delegation);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (entry.watcher == null || entry.ignoreCheck != null || !this.canPruneIgnoredDirectories()) {\n\t\t\treturn;\n\t\t}\n\t\tif (entry.reading) {\n\t\t\tentry.rereadQueued = true;\n\t\t\treturn;\n\t\t}\n\n\t\tvoid this.refreshIgnoredDirectories(entry);\n\t}\n\n\tprivate async refreshIgnoredDirectories(entry: WorkingTreeWatcherEntry): Promise<void> {\n\t\tconst getIgnoredDirectories = this.getIgnoredDirectories;\n\t\tif (getIgnoredDirectories == null) return;\n\n\t\tentry.reading = true;\n\t\ttry {\n\t\t\tconst generation = entry.generation;\n\t\t\tconst unpruned = entry.unpruned?.size ? [...entry.unpruned] : undefined;\n\n\t\t\tlet directories: readonly string[] | undefined;\n\t\t\ttry {\n\t\t\t\tdirectories = await getIgnoredDirectories(entry.session.repoPath);\n\t\t\t} catch {\n\t\t\t\tdirectories = undefined;\n\t\t\t}\n\n\t\t\tif (entry.generation === generation) {\n\t\t\t\tif (directories != null) {\n\t\t\t\t\tthis.swapWorkingTreeWatcher(entry, directories);\n\t\t\t\t\tif (entry.filter != null) {\n\t\t\t\t\t\tthis.keptIgnoredDirectories.set(entry.filter, directories);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (unpruned != null) {\n\t\t\t\t\tthis.settleUnprunedDirectories(entry, unpruned, directories);\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\tentry.reading = false;\n\n\t\t\tif (entry.rereadQueued) {\n\t\t\t\tentry.rereadQueued = false;\n\t\t\t\tif (entry.refreshTimer == null && this.wtWatchers.get(entry.session.repoPath) === entry) {\n\t\t\t\t\tthis.refreshIgnorePruning(entry);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async refreshDelegatedIgnores(\n\t\tentry: WorkingTreeWatcherEntry,\n\t\tdelegation: GitIgnoreDelegation,\n\t): Promise<void> {\n\t\tconst repoPath = entry.session.repoPath;\n\t\tconst generation = entry.generation;\n\t\tconst initial = !delegation.initialApplied;\n\t\tconst verifyingStartup = !initial && !delegation.verified;\n\t\tconst reason = initial ? 'initial' : verifyingStartup ? 'recovery' : (delegation.pendingRefresh ?? 'worktree');\n\t\tdelegation.refreshing = true;\n\n\t\ttry {\n\t\t\tconst record = this.sessionMap.get(repoPath);\n\t\t\tconst refreshConfig = verifyingStartup || (this.trackedPruning && reason !== 'worktree');\n\t\t\tconst reloadAfterRead =\n\t\t\t\trefreshConfig && (initial || verifyingStartup || !entry.filter?.canInvalidateConfig);\n\t\t\tlet inputs: GitIgnoreWatchInputs | undefined;\n\t\t\ttry {\n\t\t\t\tif (record != null) {\n\t\t\t\t\tinputs = await this.getGitIgnoreWatchInputs?.(repoPath, record.gitDir, {\n\t\t\t\t\t\trefreshConfig: reloadAfterRead,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (refreshConfig && entry.generation === generation && entry.delegation === delegation) {\n\t\t\t\t\tawait (reloadAfterRead ? entry.filter?.refresh() : entry.filter?.ready());\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (entry.generation !== generation || entry.delegation !== delegation) return;\n\t\t\tif (\n\t\t\t\tinputs == null ||\n\t\t\t\t(this.trackedPruning &&\n\t\t\t\t\t(!Array.isArray(inputs.protectedPaths) || !Array.isArray(inputs.configWatchPaths)))\n\t\t\t) {\n\t\t\t\tthis.relinquishIgnoreDelegation(entry);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tawait delegation.watcher.refreshGitIgnores(reason, inputs);\n\t\t\t} catch {\n\t\t\t\tif (entry.delegation === delegation && this.wtWatchers.get(repoPath) === entry) {\n\t\t\t\t\tthis.relinquishIgnoreDelegation(entry);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (entry.delegation !== delegation || this.wtWatchers.get(repoPath) !== entry) return;\n\t\t\tif (initial) {\n\t\t\t\tdelegation.initialApplied = true;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tawait entry.filter?.ready().catch(() => undefined);\n\t\t\tif (entry.generation !== generation || entry.delegation !== delegation) return;\n\n\t\t\tdelegation.verified = true;\n\t\t\tthis.reconcileWorkingTreeLifecycle(entry, entry.reliability, {\n\t\t\t\trescan: !verifyingStartup && !entry.starting,\n\t\t\t});\n\t\t} catch {\n\t\t\tif (\n\t\t\t\tentry.generation === generation &&\n\t\t\t\tthis.wtWatchers.get(repoPath) === entry &&\n\t\t\t\tentry.delegation === delegation\n\t\t\t) {\n\t\t\t\tthis.relinquishIgnoreDelegation(entry);\n\t\t\t}\n\t\t} finally {\n\t\t\tdelegation.refreshing = false;\n\t\t\tif (entry.generation === generation) {\n\t\t\t\tdelegation.pendingRefresh = undefined;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tentry.delegation === delegation &&\n\t\t\t\tthis.wtWatchers.get(repoPath) === entry &&\n\t\t\t\tentry.refreshTimer == null &&\n\t\t\t\t(delegation.pendingRefresh != null || (delegation.initialApplied && !delegation.verified))\n\t\t\t) {\n\t\t\t\tthis.refreshIgnorePruning(entry);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate relinquishIgnoreDelegation(entry: WorkingTreeWatcherEntry): void {\n\t\tconst delegation = entry.delegation;\n\t\tif (delegation == null) return;\n\n\t\tentry.delegation = undefined;\n\t\tentry.watcher = undefined;\n\t\tentry.starting = false;\n\t\tentry.awaitingStartAck = false;\n\t\tentry.generation++;\n\t\tclearTimeout(entry.refreshTimer);\n\t\tentry.refreshTimer = undefined;\n\t\tdelegation.watcher.dispose();\n\n\t\tthis.placeFallbackWorkingTreeWatcher(entry, true);\n\t}\n\n\tprivate placeFallbackWorkingTreeWatcher(entry: WorkingTreeWatcherEntry, withdrawing = false): void {\n\t\tlet created: CreatedWorkingTreeWatcher;\n\t\ttry {\n\t\t\tcreated = this.createWorkingTreeWatcher(entry.session.repoPath, entry.onEvent, workingTreeExcludes);\n\t\t} catch {\n\t\t\tthis.reconcileWorkingTreeLifecycle(entry, 'unwatchable', { initial: true, rescan: withdrawing });\n\t\t\treturn;\n\t\t}\n\n\t\tentry.watcher = created.watcher;\n\t\tentry.awaitingStartAck = created.awaitingStartAck;\n\t\tentry.starting = created.awaitingStartAck;\n\t\tthis.reconcileWorkingTreeLifecycle(entry, created.reliability, {\n\t\t\tinitial: true,\n\t\t\trescan: !entry.starting || created.reliability === 'unwatchable',\n\t\t});\n\t\tthis.refreshIgnorePruning(entry);\n\t}\n\n\t/**\n\t * A directory the read left unexcluded is one git won't prune (or the read failed), so it never triggers a read\n\t * again until ignore rules change — otherwise each of its events would spawn git.\n\t */\n\tprivate settleUnprunedDirectories(\n\t\tentry: WorkingTreeWatcherEntry,\n\t\tunpruned: readonly string[],\n\t\tdirectories: readonly string[] | undefined,\n\t): void {\n\t\tfor (const dir of unpruned) {\n\t\t\tentry.unpruned?.delete(dir);\n\t\t\tif (directories?.some(d => d === dir || dir.startsWith(`${d}/`))) continue;\n\n\t\t\tentry.unprunable ??= new Set();\n\t\t\tentry.unprunable.add(dir);\n\t\t}\n\t}\n\n\tprivate swapWorkingTreeWatcher(entry: WorkingTreeWatcherEntry, directories: readonly string[]): void {\n\t\tconst previous = entry.ignoredDirectories;\n\t\tif (previous.length === directories.length && previous.every(d => directories.includes(d))) return;\n\n\t\tlet created: CreatedWorkingTreeWatcher;\n\t\ttry {\n\t\t\tcreated = this.createWorkingTreeWatcher(entry.session.repoPath, entry.onEvent, [\n\t\t\t\t...workingTreeExcludes,\n\t\t\t\t...directories,\n\t\t\t]);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\n\t\tconst previousWatcher = entry.watcher;\n\t\tentry.watcher = created.watcher;\n\t\tentry.awaitingStartAck = created.awaitingStartAck;\n\t\tentry.starting = created.awaitingStartAck;\n\t\tentry.ignoredDirectories = directories;\n\t\tpreviousWatcher?.dispose();\n\t\tthis.reconcileWorkingTreeLifecycle(entry, created.reliability, {\n\t\t\trescan: previous.some(d => !directories.some(n => n === d || d.startsWith(`${n}/`))),\n\t\t});\n\t}\n\n\tprivate refreshWorkingTreeFilter(repoPath: string, reason: 'metadata' | 'recovery' = 'metadata'): void {\n\t\tconst entry = this.wtWatchers.get(repoPath);\n\t\tif (entry == null) return;\n\n\t\tthis.invalidateIgnoreCheck(entry);\n\t\tif (entry.filter != null) {\n\t\t\tthis.reloadIgnoreFilter(entry.filter, entry.delegation != null);\n\t\t}\n\t\tthis.scheduleIgnorePruningRefresh(entry, reason);\n\t}\n\n\tprivate reloadIgnoreFilter(filter: GitIgnoreFilter, delegatedConfigChange: boolean): void {\n\t\tconst configChanged = delegatedConfigChange && this.trackedPruning;\n\t\tif (configChanged && !filter.canInvalidateConfig) return;\n\n\t\tvoid filter.refresh({ configChanged: configChanged });\n\t}\n\n\tprivate disposeSessionRecord(record: SessionRecord): void {\n\t\t// The working tree first: with it still up, leaving the group would read as a move back to `'events'` and\n\t\t// announce one for a repository that is going away\n\t\tthis.stopWorkingTreeWatcher(record.session.repoPath);\n\t\tthis.disconnectFromWatchGroup(record);\n\t\tthis.updateWatchMode(record);\n\t\trecord.session.dispose();\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAgCA,MAAM,8BAA8B;AAEpC,MAAM,sBAAsB;AAC5B,MAAM,qBAAqB;AAY3B,MAAM,8BAA8B;;;;;;;;;;;;AA8LpC,IAAa,yBAAb,MAAiE;CAChE,yBAA0C,IAAI,QAAgC;;CAE9E,IAAI,wBAAuD;EAC1D,OAAO,KAAK,uBAAuB;CACpC;CAEA,0BAA2C,IAAI,QAAgB;;;CAG/D,IAAI,yBAAwC;EAC3C,OAAO,KAAK,wBAAwB;CACrC;CAEA,wBAAyC,IAAI,QAAgB;;;;;;CAM7D,IAAI,uBAAsC;EACzC,OAAO,KAAK,sBAAsB;CACnC;CAEA,wBAAyC,IAAI,QAAuD;;;;;;CAMpG,IAAI,uBAA6E;EAChF,OAAO,KAAK,sBAAsB;CACnC;CAEA,0B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;CACxB;AACD"}
@@ -654,8 +654,8 @@ var CliGitProvider = class {
654
654
  const commonGitDirPath = (gitDir.commonUri ?? gitDir.uri).fsPath;
655
655
  const excludesFilePath = config.excludesFile == null ? getDefaultGlobalExcludesPath(gitEnv) : resolveGitPathConfig(config.excludesFile, repoPath, gitEnv);
656
656
  if (!path.isAbsolute(commonGitDirPath) || config.excludesFile != null && excludesFilePath == null || excludesFilePath != null && !path.isAbsolute(excludesFilePath)) return;
657
- const configWatchPaths = await this.getConfigWatchPaths(repoPath, gitEnv);
658
- if (configWatchPaths == null) return void 0;
657
+ const systemAndGlobalConfigPaths = await this.getConfigWatchPaths(repoPath, gitEnv);
658
+ if (systemAndGlobalConfigPaths == null) return void 0;
659
659
  const sharedIndex = await this._git.run({
660
660
  cwd: repoPath,
661
661
  env: gitEnv,
@@ -690,7 +690,7 @@ var CliGitProvider = class {
690
690
  infoExcludePath: path.join(commonGitDirPath, "info", "exclude"),
691
691
  excludesFilePath: excludesFilePath ?? null,
692
692
  ignoreCase: ignoreCase ?? false,
693
- configWatchPaths,
693
+ configWatchPaths: [.../* @__PURE__ */ new Set([...systemAndGlobalConfigPaths, path.join(commonGitDirPath, "config")])],
694
694
  protectedPaths: [...protectedPaths].sort(),
695
695
  protectedDirectories: Array.from(protectedDirectories, (directory) => directory.slice(0, -1)).sort()
696
696
  };
@@ -1 +1 @@
1
- {"version":3,"file":"cliGitProvider.js","names":["fs"],"sources":["../../../git-cli/src/cliGitProvider.ts"],"sourcesContent":["import { promises as fs } from 'node:fs';\nimport { homedir } from 'node:os';\nimport * as path from 'node:path';\nimport type { CachedGitTypes, MergeTargetsChangeEvent } from '@gitlens/git/cache.js';\nimport { Cache, resetDropsPendingRuns } from '@gitlens/git/cache.js';\nimport type { GitServiceContext } from '@gitlens/git/context.js';\nimport type { GitFileStatus } from '@gitlens/git/models/fileStatus.js';\nimport type { GitDir, RepositoryChange } from '@gitlens/git/models/repository.js';\nimport { deletedOrMissing } from '@gitlens/git/models/revision.js';\nimport type { GitOperationRunOptions } from '@gitlens/git/providers/operations.js';\nimport type {\n\tAnnouncedRepositoryChanges,\n\tGitProvider,\n\tGitProviderDescriptor,\n} from '@gitlens/git/providers/provider.js';\nimport type { GitCommandPriority } from '@gitlens/git/run.types.js';\nimport { parseGitRemoteUrl } from '@gitlens/git/utils/remote.utils.js';\nimport { isUncommitted } from '@gitlens/git/utils/revision.utils.js';\nimport { getRefChangeKind } from '@gitlens/git/watching/changeEvent.js';\nimport { GitIgnoreFilter } from '@gitlens/git/watching/gitIgnoreFilter.js';\nimport type { GitIgnoreWatchInputs } from '@gitlens/git/watching/provider.js';\nimport { sanitizeIgnoredWorktreeFolders } from '@gitlens/git/watching/watcherPatterns.js';\nimport { isCancellationError } from '@gitlens/utils/cancellation.js';\nimport type { Event } from '@gitlens/utils/event.js';\nimport { Emitter } from '@gitlens/utils/event.js';\nimport { getScopedLogger } from '@gitlens/utils/logger.scoped.js';\nimport { joinPaths, maybeUri, normalizePath, splitPath, trimTrailingSlashes } from '@gitlens/utils/path.js';\nimport { isWindows } from '@gitlens/utils/platform.js';\nimport { cancellable } from '@gitlens/utils/promise.js';\nimport { iterateByDelimiter } from '@gitlens/utils/string.js';\nimport type { Uri } from '@gitlens/utils/uri.js';\nimport { fileUri, joinUriPath, parseUri, toFsPath } from '@gitlens/utils/uri.js';\nimport { worktreeSharedChanges } from './exec/commandClassifier.js';\nimport { fsExists } from './exec/exec.js';\nimport type { FilteredGitFeatures, GitFeatureOrPrefix, GitFeatures } from './exec/features.js';\nimport type { GitFeatureUnsupportedMessage, GitOptions, NamedRefs } from './exec/git.js';\nimport { batchLiteralPathspecs, Git, gitConfigsStatus, GitError, GitErrors } from './exec/git.js';\nimport { isGitDirMovedByEnv } from './exec/gitDirResolver.js';\nimport { readCommonGitDir, readHeadState } from './exec/headState.js';\nimport type { IndexRefresherOptions } from './exec/indexRefresh.js';\nimport { IndexRefresher } from './exec/indexRefresh.js';\nimport type { GitLocation } from './exec/locator.js';\nimport { foldMatchingIgnored } from './parsers/statusParser.js';\nimport { BlameGitSubProvider } from './providers/blame.js';\nimport { BranchesGitSubProvider } from './providers/branches.js';\nimport { CommitsGitSubProvider } from './providers/commits.js';\nimport { ConfigGitSubProvider, isGitBooleanFalse, parseGitBoolean } from './providers/config.js';\nimport { ContributorsGitSubProvider } from './providers/contributors.js';\nimport { DiffGitSubProvider } from './providers/diff.js';\nimport { GraphGitSubProvider } from './providers/graph.js';\nimport { MaintenanceGitSubProvider } from './providers/maintenance.js';\nimport { OperationsGitSubProvider } from './providers/operations.js';\nimport { PatchGitSubProvider } from './providers/patch.js';\nimport { PausedOperationsGitSubProvider } from './providers/pausedOperations.js';\nimport { RefsGitSubProvider } from './providers/refs.js';\nimport { RemotesGitSubProvider } from './providers/remotes.js';\nimport { RevisionGitSubProvider } from './providers/revision.js';\nimport { StagingGitSubProvider } from './providers/staging.js';\nimport { StashGitSubProvider } from './providers/stash.js';\nimport { StatusGitSubProvider } from './providers/status.js';\nimport { TagsGitSubProvider } from './providers/tags.js';\nimport { WorktreesGitSubProvider } from './providers/worktrees.js';\n\n/** How long reading the folders whose worktrees are ignored may take before it counts as failed (a hung mount) */\nconst ignoredWorktreeRootsTimeoutMs = 5000;\nconst maxProtectedWatchPaths = 4096;\nconst maxProtectedWatchListingBytes = 1024 * 1024;\nconst ignoreConfigOverrideRegex = /core\\.(?:excludesfile|ignorecase)/i;\n\nexport interface CliGitProviderOptions {\n\t/** Use an existing Cache instance, or one will be created */\n\tcache?: Cache;\n\t/** Context providing config and event bus hooks */\n\tcontext: GitServiceContext;\n\t/** Function that resolves the git binary location (path + version) */\n\tlocator: () => Promise<GitLocation>;\n\t/** Pre-built Git executor — when provided, used instead of creating a new Git from locator/options */\n\tgit?: Git;\n\t/** Git execution options (timeout, trust, queue config, hooks, etc.) */\n\tgitOptions?: GitOptions;\n\t/**\n\t * Whether repositories reached through this provider are on the LOCAL filesystem. `false` disables the\n\t * maintenance sub-provider entirely (Live Share): its probes stat local paths, and its writes are\n\t * rejected by the host's command allowlist, so inheriting it yields empty reports and swallowed\n\t * failures rather than an honest \"unsupported here\". Defaults to `true`.\n\t */\n\tlocalRepositories?: boolean;\n\t/**\n\t * Folders, relative to a repository's common git dir, whose worktrees core acts as if didn't exist: they are left out\n\t * of worktree lists, and their add, remove, lock, unlock or move run through `notify: 'infer'`, and the watcher's\n\t * reports of their admin entries, raise no `worktrees` change. The typed worktree writes still announce one. A host\n\t * registers one for a tool's throwaway worktrees, which no host shows (sync-tools' `sync-tools-worktrees`, for one).\n\t * Nothing else is ignored, since a user may keep real worktrees anywhere, the git dir included. A folder that isn't\n\t * a literal path strictly inside the common git dir, or that lies under `worktrees`, is dropped.\n\t */\n\tignoredWorktreeFolders?: readonly string[];\n\t/**\n\t * Refreshes a checkout's index in the background after core's own clone, worktree add, checkout, restore, merge, pull,\n\t * reset, cherry-pick, revert, rebase, stash apply, pop and push, and abort or continue of a paused operation rewrote\n\t * it, so later status and diff reads stop re-hashing the files written in the index's second. A write that stops on\n\t * conflicts refreshes too, since the files it rewrote first are read the most while the conflicts are resolved. Off\n\t * by default: each costs a status of the whole checkout, worth it only where that checkout will be read again.\n\t * `scheduleIndexRefresh` runs either way.\n\t */\n\trefreshIndexAfterWrites?: boolean;\n\t/** The clock and timer behind the background index refresh, for tests; the real ones by default */\n\tindexRefresh?: Pick<IndexRefresherOptions, 'now' | 'setTimer'>;\n}\n\n/**\n * Exposes `isTrackedWithDetails` as a callable method for sub-providers.\n * The class declares it as a regular method, but TypeScript's structural\n * typing makes it inaccessible through the class type alone when consumed\n * internally — this type re-maps it to ensure sub-providers can call it.\n */\nexport type CliGitProviderInternal = Omit<CliGitProvider, 'isTrackedWithDetails'> & {\n\tisTrackedWithDetails: CliGitProvider['isTrackedWithDetails'];\n};\n\n/**\n * A fully-wired CLI-based git provider that executes git commands via `child_process`.\n * Implements both `CliGitProviderInternal` (for internal sub-provider wiring)\n * and `GitProvider` (for registration in a provider registry).\n *\n * @example\n * ```typescript\n * const provider = new CliGitProvider({\n * context: { events: myEvents },\n * locator: () => findGitPath(null),\n * gitOptions: { gitTimeout: 30000 },\n * });\n *\n * const branches = await provider.branches.getBranches(repoPath);\n * const status = await provider.status.getStatus(repoPath);\n * ```\n */\nexport class CliGitProvider implements GitProvider {\n\treadonly descriptor: GitProviderDescriptor = { id: 'git', name: 'Git', virtual: false };\n\n\tprivate readonly _cache: Cache;\n\tprivate readonly _cacheOwned: boolean;\n\tprivate readonly _git: Git;\n\n\treadonly context: GitServiceContext;\n\t/** The host's own hooks, before the provider wraps `cache.onReset` with its own clearing */\n\tprivate readonly _hostHooks: GitServiceContext['hooks'];\n\tprivate readonly _localRepositories: boolean;\n\tprivate readonly _ignoredWorktreeFolders: readonly string[];\n\t/** By common git dir, the folders whose worktrees are ignored there: a common git dir never moves while it is open */\n\tprivate readonly _ignoredWorktreeRoots = new Map<string, Promise<readonly string[]>>();\n\tprivate readonly _configWatchPaths = new WeakMap<\n\t\tReadonly<Record<string, string | undefined>>,\n\t\tPromise<readonly string[] | undefined>\n\t>();\n\tprivate readonly _indexRefresher: IndexRefresher;\n\tprivate readonly _unregisterListener: { dispose(): void };\n\tprivate readonly _resetListener: { dispose(): void };\n\n\tconstructor(options: CliGitProviderOptions) {\n\t\t// Every typed write announces itself through `onReset`, so the provider clears its own state there\n\t\t// rather than trusting each host to: a host with no handler still reads fresh after a write. A write\n\t\t// hard-evicts, so a caller after it never joins a read that started before it; watcher-driven clears\n\t\t// reach `Cache.clearCaches` directly and keep sharing in-flight reads.\n\t\tconst hostHooks = options.context.hooks;\n\t\tthis._hostHooks = hostHooks;\n\t\tthis.context = {\n\t\t\t...options.context,\n\t\t\thooks: {\n\t\t\t\t...hostHooks,\n\t\t\t\tcache: {\n\t\t\t\t\t...hostHooks?.cache,\n\t\t\t\t\tonReset: (repoPath, ...types) => {\n\t\t\t\t\t\tthis._cache.evictCaches(repoPath, ...types);\n\t\t\t\t\t\tif (resetDropsPendingRuns(types)) {\n\t\t\t\t\t\t\tthis._git.clearPendingCommands(this.getRepositoryPaths(repoPath));\n\t\t\t\t\t\t}\n\t\t\t\t\t\thostHooks?.cache?.onReset?.(repoPath, ...types);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trepository: {\n\t\t\t\t\t...hostHooks?.repository,\n\t\t\t\t\tonChanged: (repoPath, changes, refs, options) =>\n\t\t\t\t\t\tthis.announceWrite(repoPath, changes, refs, {\n\t\t\t\t\t\t\tconfigConfinedToRefs: options?.configConfinedToRefs,\n\t\t\t\t\t\t\tmovedWorktrees: this.getMovedWorktrees([repoPath], changes),\n\t\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t\tthis._localRepositories = options.localRepositories ?? true;\n\t\tthis._ignoredWorktreeFolders = sanitizeIgnoredWorktreeFolders(options.ignoredWorktreeFolders);\n\t\tthis._git =\n\t\t\toptions.git ??\n\t\t\tnew Git(options.locator, {\n\t\t\t\t...options.gitOptions,\n\t\t\t\t// The workspace flag, when the context has one, answers for every path; otherwise the host's own\n\t\t\t\t// per-path predicate (`gitOptions.isTrusted`) stands, so a multi-repository host can refuse one repository\n\t\t\t\tisTrusted:\n\t\t\t\t\toptions.context.workspace?.isTrusted != null\n\t\t\t\t\t\t? () => options.context.workspace!.isTrusted!\n\t\t\t\t\t\t: options.gitOptions?.isTrusted,\n\t\t\t});\n\t\tthis._cacheOwned = !(options.cache instanceof Cache);\n\t\tthis._cache = options.cache instanceof Cache ? options.cache : new Cache();\n\t\tthis._indexRefresher = new IndexRefresher({\n\t\t\t...options.indexRefresh,\n\t\t\tafterWrites: options.refreshIndexAfterWrites,\n\t\t\tgit: this._git,\n\t\t\tstatIndexMtimeMs: checkoutPath => this.statIndexMtimeMs(checkoutPath),\n\t\t});\n\n\t\t// Wires a raw `git.run({ notify })` call back to this provider's own cache/host announcement —\n\t\t// unconditionally, so a host-supplied `options.git` gets bound exactly like one we construct here.\n\t\tthis._git.bindChangeNotifier((repoPaths, changes, sharedPaths, named) =>\n\t\t\tthis.notifyChangedCore(repoPaths, changes, undefined, sharedPaths, named),\n\t\t);\n\t\tthis._git.bindHeadReader(path => readHeadState(path, this.context.fs, this._cache));\n\t\t// Bound even with no folder registered, so a `Git` shared with another provider never keeps that one's folders\n\t\tthis._git.bindIgnoredWorktreeRootsReader(path => this.getIgnoredWorktreeRoots(path));\n\t\tthis._unregisterListener = this._cache.onDidUnregisterRepoPath(repoPath =>\n\t\t\tthis._git.clearPendingCommands([repoPath]),\n\t\t);\n\t\tthis._resetListener = this._cache.onDidReset(() => this._git.clearPendingCommands());\n\t}\n\n\t/** The underlying cache instance (for repo path registration, etc.) */\n\tget cache(): Cache {\n\t\treturn this._cache;\n\t}\n\n\t/** The per-checkout queue that refreshes an index a write left with untrusted entries */\n\tget indexRefresher(): IndexRefresher {\n\t\treturn this._indexRefresher;\n\t}\n\n\tprivate async statIndexMtimeMs(checkoutPath: string): Promise<number | undefined> {\n\t\ttry {\n\t\t\tlet gitDir = this._cache.gitDir.get(checkoutPath);\n\t\t\tif (gitDir == null) {\n\t\t\t\t// A failed clone or worktree add leaves no checkout, and resolving one there anyway would cache, for its\n\t\t\t\t// path, the git dir of whatever repository git falls back to\n\t\t\t\tif (!(await fsExists(path.join(checkoutPath, '.git')))) return undefined;\n\n\t\t\t\tgitDir = await this.config.getGitDir(checkoutPath);\n\t\t\t}\n\t\t\treturn (await fs.stat(path.join(gitDir.uri.fsPath, 'index'))).mtimeMs;\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tget onDidChangeMergeTargets(): Event<MergeTargetsChangeEvent> {\n\t\treturn this._cache.onDidChangeMergeTargets;\n\t}\n\n\tgetIgnoredWorktreeFolders(_repoPath: string): readonly string[] {\n\t\treturn this._ignoredWorktreeFolders;\n\t}\n\n\t/**\n\t * `[]`, reading nothing, when no folder is registered. Read once per common git dir, since a worktree list rebuild\n\t * and every inferred worktree write ask for them; a read that fails or doesn't settle in time (a hung mount) rejects,\n\t * and isn't kept, so the next call reads again\n\t */\n\tasync getIgnoredWorktreeRoots(repoPath: string): Promise<readonly string[]> {\n\t\tif (!this._ignoredWorktreeFolders.length) return [];\n\n\t\tconst commonGitDir = await cancellable(this.findCommonGitDir(repoPath), ignoredWorktreeRootsTimeoutMs);\n\t\tlet roots = this._ignoredWorktreeRoots.get(commonGitDir);\n\t\tif (roots == null) {\n\t\t\tconst read = cancellable(this.readIgnoredWorktreeRoots(commonGitDir), ignoredWorktreeRootsTimeoutMs);\n\t\t\tconst entry = read.then(r => r.roots);\n\t\t\troots = entry;\n\t\t\tthis._ignoredWorktreeRoots.set(commonGitDir, entry);\n\t\t\tconst forget = () => {\n\t\t\t\tif (this._ignoredWorktreeRoots.get(commonGitDir) === entry) {\n\t\t\t\t\tthis._ignoredWorktreeRoots.delete(commonGitDir);\n\t\t\t\t}\n\t\t\t};\n\t\t\t// Roots missing the resolved spelling still serve this call, but a later one resolves again\n\t\t\tvoid read.then(r => (r.resolved ? undefined : forget()), forget);\n\t\t}\n\t\treturn roots;\n\t}\n\n\t/**\n\t * From the cached git dir, or the repository's own files, without running git; a repository whose files don't\n\t * show it (a bare one) runs git once, and the git dir it finds is cached with the repository\n\t */\n\tprivate async findCommonGitDir(repoPath: string): Promise<string> {\n\t\tconst commonGitDir = await readCommonGitDir(repoPath, this.context.fs, this._cache);\n\t\tif (commonGitDir != null) return commonGitDir;\n\n\t\tconst gitDir = await this.config.getGitDir(repoPath);\n\t\treturn (gitDir.commonUri ?? gitDir.uri).fsPath;\n\t}\n\n\t/** `resolved` is false when the common git dir's resolved spelling couldn't be read */\n\tprivate async readIgnoredWorktreeRoots(\n\t\tcommonGitDir: string,\n\t): Promise<{ readonly roots: readonly string[]; readonly resolved: boolean }> {\n\t\tconst roots = new Set(this._ignoredWorktreeFolders.map(f => normalizePath(joinPaths(commonGitDir, f))));\n\t\tif (!this._localRepositories) return { roots: [...roots], resolved: true };\n\n\t\t// Only the common git dir is resolved: a folder doesn't exist until its tool first makes a worktree there\n\t\tconst realCommonGitDir = await fs.realpath(commonGitDir).catch(() => undefined);\n\t\tif (realCommonGitDir == null) return { roots: [...roots], resolved: false };\n\n\t\tfor (const folder of this._ignoredWorktreeFolders) {\n\t\t\troots.add(normalizePath(joinPaths(realCommonGitDir, folder)));\n\t\t}\n\t\treturn { roots: [...roots], resolved: true };\n\t}\n\n\tensureRegistered(repoPath: string): Promise<void> | undefined {\n\t\treturn this._cache.ensureRegistered(repoPath);\n\t}\n\n\tgetCommonPath(repoPath: string): string | undefined {\n\t\t// An unregistered path is its own common path in the cache, which would hide a sibling worktree's writes\n\t\treturn this._cache.isRegistered(repoPath) ? this._cache.getCommonPath(repoPath) : undefined;\n\t}\n\n\tprivate readonly _onDidAnnounceChanges = new Emitter<AnnouncedRepositoryChanges>();\n\tget onDidAnnounceChanges(): Event<AnnouncedRepositoryChanges> {\n\t\treturn this._onDidAnnounceChanges.event;\n\t}\n\n\t/** The underlying git execution instance (for sub-providers that need direct exec/stream access) */\n\tget git(): Git {\n\t\treturn this._git;\n\t}\n\n\t/** Returns whether the installed git version supports the given feature. */\n\tsupports(feature: GitFeatures): boolean | Promise<boolean> {\n\t\treturn this._git.supports(feature);\n\t}\n\n\t/** Returns all features matching the prefix that the installed git version supports. */\n\tsupported<T extends GitFeatureOrPrefix>(feature: T): FilteredGitFeatures<T>[] | Promise<FilteredGitFeatures<T>[]> {\n\t\treturn this._git.supported(feature);\n\t}\n\n\t/** Throws if the installed git version does not support the given feature. */\n\tasync ensureSupports(feature: GitFeatures, prefix: string, suffix: string): Promise<void>;\n\tasync ensureSupports(feature: GitFeatures, message: GitFeatureUnsupportedMessage): Promise<void>;\n\tasync ensureSupports(\n\t\tfeature: GitFeatures,\n\t\tprefixOrMessage: string | GitFeatureUnsupportedMessage,\n\t\tsuffix?: string,\n\t): Promise<void> {\n\t\treturn typeof prefixOrMessage === 'function'\n\t\t\t? this._git.ensureSupports(feature, prefixOrMessage)\n\t\t\t: this._git.ensureSupports(feature, prefixOrMessage, suffix!);\n\t}\n\n\t/** Returns the installed git version string. */\n\tasync version(): Promise<string> {\n\t\treturn this._git.version();\n\t}\n\n\t/** Returns the resolved git binary path. */\n\tasync path(): Promise<string> {\n\t\treturn this._git.path();\n\t}\n\n\tasync clone(\n\t\turl: string,\n\t\tparentPath: string,\n\t\toptions?: { folderName?: string },\n\t\trunOptions?: GitOperationRunOptions,\n\t): Promise<string | undefined> {\n\t\tlet folderPath: string;\n\t\tif (options?.folderName) {\n\t\t\tfolderPath = joinPaths(parentPath, options.folderName);\n\t\t} else {\n\t\t\tconst [, , remotePath] = parseGitRemoteUrl(url);\n\t\t\tconst remoteName = remotePath.split('/').pop();\n\t\t\tif (!remoteName) return undefined;\n\n\t\t\tlet count = 0;\n\t\t\tfolderPath = joinPaths(parentPath, remoteName);\n\t\t\twhile ((await fsExists(folderPath)) && count < 20) {\n\t\t\t\tcount++;\n\t\t\t\tfolderPath = joinPaths(parentPath, `${remoteName}-${count}`);\n\t\t\t}\n\t\t}\n\n\t\t// `throw`: the default handler swallows `remoteConnectionError`, which would return a folder never cloned\n\t\tawait this._indexRefresher.refreshAfter(folderPath, () =>\n\t\t\tthis._git.run({ cwd: parentPath, errors: 'throw', ...runOptions }, 'clone', url, folderPath),\n\t\t);\n\n\t\treturn folderPath;\n\t}\n\n\t/** Creates a new repository at `targetPath` (`git init`), creating it first if it doesn't yet exist. */\n\tasync init(targetPath: string, options?: { defaultBranch?: string; bare?: boolean }): Promise<void> {\n\t\tawait fs.mkdir(targetPath, { recursive: true });\n\n\t\tconst args = ['init'];\n\t\tif (options?.defaultBranch) {\n\t\t\targs.push('-b', options.defaultBranch);\n\t\t}\n\t\tif (options?.bare) {\n\t\t\targs.push('--bare');\n\t\t}\n\n\t\t// Run inside the target rather than naming it from its parent: a relative `targetPath` would otherwise\n\t\t// be resolved against the parent a second time\n\t\tawait this._git.run({ cwd: targetPath }, ...args);\n\t}\n\n\t/**\n\t * Notifies the provider that `repoPath` was mutated outside of a typed sub-provider method — e.g. a\n\t * consumer that ran a command through the raw `git.run`/`provider.git.run` escape hatch. Fires the same\n\t * `cache.onReset`/`repository.onChanged` hooks a typed mutator would, so, exactly as after a typed write,\n\t * the provider hard-evicts its own caches for `repoPath` and drops its pending commands for the repository\n\t * (its sibling worktrees included) before the host's handlers run.\n\t *\n\t * What is reset: `options.cache` when given (`'all'` for everything, `[]` for nothing); otherwise the\n\t * cache types `changes` map to, the same mapping a file watcher's changes get, status clock included.\n\t * An empty `changes`, or one naming `'unknown'` or `'closed'`, resets everything. Changes that map to\n\t * no cache type (e.g. `'starred'`) reset nothing, and `onReset` doesn't fire; `onChanged` always fires.\n\t */\n\tnotifyChanged(\n\t\trepoPath: string,\n\t\tchanges: readonly RepositoryChange[],\n\t\toptions?: { cache?: readonly CachedGitTypes[] | 'all' },\n\t): void {\n\t\tthis.notifyChangedCore([repoPath], changes, options);\n\t}\n\n\t/**\n\t * {@link notifyChanged} for one change seen from several paths, e.g. a `-C` shared-state verb announced\n\t * for both its target and the caller's `cwd`. Each path's caches are reset and the host's `onReset` fires\n\t * for each, since a host may keep per-worktree state, but a repository's pending commands are dropped once\n\t * however many of its worktrees are named.\n\t *\n\t * Each path hears the announcement once: `repoPaths` hear all of `changes`, `sharedPaths` (reset and\n\t * `onReset`-ed like `repoPaths`) and then the other registered worktrees sharing a repository with any of\n\t * them (reset like a typed write's, with no `onReset`) hear the shared part of it, see\n\t * {@link getSiblingChanges}. `names.refs` reach `repoPaths` whole and the others as {@link getSharedRefs}.\n\t */\n\tprivate notifyChangedCore(\n\t\trepoPaths: readonly string[],\n\t\tchanges: readonly RepositoryChange[],\n\t\toptions?: { cache?: readonly CachedGitTypes[] | 'all' },\n\t\tsharedPaths?: readonly string[],\n\t\tnames?: NamedRefs,\n\t): void {\n\t\tconst announcements = new Map<string, readonly RepositoryChange[]>();\n\t\tfor (const repoPath of repoPaths) {\n\t\t\tannouncements.set(repoPath, [...changes]);\n\t\t}\n\t\tconst shared = sharedPaths?.length ? this.getSharedChanges(changes) : undefined;\n\t\tif (shared != null) {\n\t\t\tfor (const path of sharedPaths!) {\n\t\t\t\tif (!announcements.has(path)) {\n\t\t\t\t\tannouncements.set(path, shared);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst resets: { repoPath: string; types: CachedGitTypes[] }[] = [];\n\t\tconst pendingPaths = new Set<string>();\n\t\tfor (const [repoPath, announced] of announcements) {\n\t\t\tconst types = this.resetForChanges(\n\t\t\t\trepoPath,\n\t\t\t\tannounced,\n\t\t\t\toptions?.cache,\n\t\t\t\trepoPaths.includes(repoPath) ? 'all' : 'shared',\n\t\t\t);\n\t\t\tif (types == null) {\n\t\t\t\t// A gk config change is reconciled outside the cache types, but its re-read must not join a pre-write run\n\t\t\t\tif (options?.cache == null && announced.includes('gkConfig')) {\n\t\t\t\t\tfor (const path of this.getRepositoryPaths(repoPath)) {\n\t\t\t\t\t\tpendingPaths.add(path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tresets.push({ repoPath: repoPath, types: types });\n\t\t\tif (resetDropsPendingRuns(types)) {\n\t\t\t\tfor (const path of this.getRepositoryPaths(repoPath)) {\n\t\t\t\t\tpendingPaths.add(path);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// The worktrees no one named: their shared refs, tags, stash, remotes and config just changed too\n\t\tconst named = [...announcements.keys()];\n\t\tfor (const repoPath of named) {\n\t\t\tfor (const [path, siblingChanges] of this.getSiblingChanges(repoPath, changes)) {\n\t\t\t\tif (announcements.has(path)) continue;\n\n\t\t\t\tannouncements.set(path, siblingChanges);\n\t\t\t\tthis.resetForChanges(path, siblingChanges, options?.cache, 'sibling');\n\t\t\t}\n\t\t}\n\n\t\tif (pendingPaths.size) {\n\t\t\tthis._git.clearPendingCommands([...pendingPaths]);\n\t\t}\n\t\tfor (const { repoPath, types } of resets) {\n\t\t\tthis._hostHooks?.cache?.onReset?.(repoPath, ...types);\n\t\t}\n\t\t// The host's own hook: `context.hooks.repository.onChanged` also fans out to siblings, which would\n\t\t// announce a path a second time\n\t\tconst sharedRefs = names?.refs.length ? getSharedRefs(changes, names.refs) : undefined;\n\t\tconst movedWorktrees = this.getMovedWorktrees(repoPaths, changes);\n\t\tfor (const [path, announced] of announcements) {\n\t\t\tthis.announceChanged(path, [...announced], repoPaths.includes(path) ? names?.refs : sharedRefs, {\n\t\t\t\tconfigConfinedToRefs: names?.configConfinedToRefs,\n\t\t\t\tmovedWorktrees: movedWorktrees,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Announces a typed write that ran in `repoPath`, as `context.hooks.repository.onChanged` does, for a write that\n\t * knows which linked worktrees' HEADs it moved (see `AnnouncedRepositoryChanges.movedWorktrees`) where `repoPath`\n\t * doesn't say: a worktree added or removed from it. `options.configConfinedToRefs` is as for the hook.\n\t *\n\t * @internal not intended to be used outside of the sub-providers\n\t */\n\tannounceWrite(\n\t\trepoPath: string,\n\t\tchanges: RepositoryChange[],\n\t\trefs?: readonly string[],\n\t\toptions?: { readonly configConfinedToRefs?: boolean; readonly movedWorktrees?: readonly string[] },\n\t): void {\n\t\t// Everything the watcher would have cleared for the write, since its own file events are dropped once it is\n\t\t// announced (the typed write's `onReset` names only what it must evict)\n\t\tthis.resetForChanges(repoPath, changes, undefined);\n\t\t// Worktrees share refs, tags, stash, remotes and config, so a typed write in one changes what its siblings show;\n\t\t// the host hears the shared part of it for each, and they read fresh. Every path is reset before any is\n\t\t// announced, so a read the host starts on hearing one path isn't evicted by the next path's reset\n\t\tconst siblings = this.getSiblingChanges(repoPath, changes);\n\t\tfor (const [path, shared] of siblings) {\n\t\t\tthis.resetForChanges(path, shared, undefined, 'sibling');\n\t\t}\n\n\t\tthis.announceChanged(repoPath, changes, refs, options);\n\t\tif (siblings.size === 0) return;\n\n\t\t// Siblings share the one `.git/config`, so the write's config is as confined for them, and they hear the same\n\t\t// worktrees moved\n\t\tconst sharedRefs = refs?.length ? getSharedRefs(changes, refs) : undefined;\n\t\tfor (const [path, shared] of siblings) {\n\t\t\tthis.announceChanged(path, shared, sharedRefs, options);\n\t\t}\n\t}\n\n\t/**\n\t * The linked worktrees whose HEAD a write that ran in `paths` moved, for a `worktreeHead` among `changes` (see\n\t * `AnnouncedRepositoryChanges.movedWorktrees`): those of `paths` when it rewrote their HEAD, which it announces as\n\t * `head`, and otherwise none, as the worktree it added or removed is unknown here; `undefined` without\n\t * `worktreeHead`\n\t */\n\tprivate getMovedWorktrees(paths: readonly string[], changes: readonly RepositoryChange[]): string[] | undefined {\n\t\tif (!changes.includes('worktreeHead')) return undefined;\n\t\tif (!changes.includes('head')) return [];\n\n\t\tconst ids: string[] = [];\n\t\tfor (const path of paths) {\n\t\t\tconst id = this._cache.getLinkedWorktreeId(normalizePath(path));\n\t\t\tif (id != null) {\n\t\t\t\tids.push(id);\n\t\t\t}\n\t\t}\n\t\treturn ids;\n\t}\n\n\t/**\n\t * Tells only the host's own `repository.onChanged` about `changes` — for a follow-up that is not a write of\n\t * core's, such as re-announcing an outside change once it was reconciled. Nothing is evicted, no sibling hears\n\t * it, and the watch layer doesn't take it for a write's announcement.\n\t */\n\tnotifyHost(repoPath: string, changes: RepositoryChange[]): void {\n\t\tthis._hostHooks?.repository?.onChanged?.(repoPath, changes);\n\t}\n\n\t/**\n\t * Tells the host about a write for one path, after its caches were reset — the watch layer hears of it first.\n\t * `refs` are the full ref names the write moved, when it knows them, and `options.configConfinedToRefs` confines\n\t * its `config` change to the sections of the local branches among them (see `GitServiceHooks.repository.onChanged`);\n\t * the confinement is passed on only with `config` among `changes` and a branch in `refs` to confine it to.\n\t * `options.movedWorktrees` reaches the watch layer alone, and only with `worktreeHead` among `changes`.\n\t */\n\tprivate announceChanged(\n\t\trepoPath: string,\n\t\tchanges: RepositoryChange[],\n\t\trefs?: readonly string[],\n\t\toptions?: { readonly configConfinedToRefs?: boolean; readonly movedWorktrees?: readonly string[] },\n\t): void {\n\t\tconst moved =\n\t\t\toptions?.movedWorktrees != null && changes.includes('worktreeHead')\n\t\t\t\t? { movedWorktrees: options.movedWorktrees }\n\t\t\t\t: undefined;\n\t\tif (refs?.length) {\n\t\t\tif (\n\t\t\t\toptions?.configConfinedToRefs === true &&\n\t\t\t\tchanges.includes('config') &&\n\t\t\t\trefs.some(r => r.startsWith('refs/heads/'))\n\t\t\t) {\n\t\t\t\tthis._onDidAnnounceChanges.fire({\n\t\t\t\t\trepoPath: repoPath,\n\t\t\t\t\tchanges: changes,\n\t\t\t\t\trefs: refs,\n\t\t\t\t\tconfigConfinedToRefs: true,\n\t\t\t\t\t...moved,\n\t\t\t\t});\n\t\t\t\tthis._hostHooks?.repository?.onChanged?.(repoPath, changes, refs, { configConfinedToRefs: true });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._onDidAnnounceChanges.fire({ repoPath: repoPath, changes: changes, refs: refs, ...moved });\n\t\t\tthis._hostHooks?.repository?.onChanged?.(repoPath, changes, refs);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._onDidAnnounceChanges.fire({ repoPath: repoPath, changes: changes, ...moved });\n\t\tthis._hostHooks?.repository?.onChanged?.(repoPath, changes);\n\t}\n\n\t/**\n\t * What the worktrees sharing a repository hear of `changes` that ran in one of them: the part worktrees\n\t * share (see {@link worktreeSharedChanges}), or `undefined` when `changes` has none. An empty `changes` or\n\t * `'unknown'` means everything may have changed, so it reaches them as every shared kind — never as\n\t * `'unknown'` itself, which a host treats as the end of a watch session; `'closed'` concerns the one path\n\t * alone and reaches none.\n\t */\n\tprivate getSharedChanges(changes: readonly RepositoryChange[]): RepositoryChange[] | undefined {\n\t\tif (changes.includes('closed')) return undefined;\n\t\tif (!changes.length || changes.includes('unknown')) return [...worktreeSharedChanges];\n\n\t\tconst shared = changes.filter(c => worktreeSharedChanges.has(c));\n\t\treturn shared.length ? shared : undefined;\n\t}\n\n\t/** What each registered worktree sharing `repoPath`'s repository, other than `repoPath`, hears of `changes`. */\n\tprivate getSiblingChanges(repoPath: string, changes: readonly RepositoryChange[]): Map<string, RepositoryChange[]> {\n\t\tconst siblings = new Map<string, RepositoryChange[]>();\n\t\tconst shared = this.getSharedChanges(changes);\n\t\tif (shared == null) return siblings;\n\n\t\tconst self = normalizePath(repoPath);\n\t\tfor (const path of this._cache.getWorktreePaths(this._cache.getCommonPath(repoPath))) {\n\t\t\tif (path !== self) {\n\t\t\t\tsiblings.set(path, [...shared]);\n\t\t\t}\n\t\t}\n\t\treturn siblings;\n\t}\n\n\t/**\n\t * Evicts what a notified change reset for `repoPath`: the types reset (`[]` = all), or `undefined` for none.\n\t * `heard` is how `repoPath` heard the write:\n\t * - `'all'`: all of it, as the path it ran in or one it was announced whole for, so the changes are announced for it\n\t * (see `Cache.applyRepositoryChanges`)\n\t * - `'shared'`: the shared part, as the caller's `cwd` of a `-C` write elsewhere, so a `'worktreeHead'` among them is\n\t * another worktree's, which `-C` may have named by a folder inside it, and every other linked worktree loses its\n\t * current branch\n\t * - `'sibling'`: the shared part, as a path sharing its repository with one already reset for the same change, which\n\t * evicted the shared entries for every worktree, so the changes evict only its own entries and advance its\n\t * status clock\n\t */\n\tprivate resetForChanges(\n\t\trepoPath: string,\n\t\tchanges: readonly RepositoryChange[],\n\t\tcache: readonly CachedGitTypes[] | 'all' | undefined,\n\t\theard: 'all' | 'shared' | 'sibling' = 'all',\n\t): CachedGitTypes[] | undefined {\n\t\tif (cache != null && cache !== 'all') {\n\t\t\tif (!cache.length) return undefined;\n\n\t\t\tthis._cache.evictCaches(repoPath, ...cache);\n\t\t\treturn [...cache];\n\t\t}\n\n\t\tif (cache === 'all' || !changes.length || changes.some(c => c === 'unknown' || c === 'closed')) {\n\t\t\tthis._cache.evictCaches(repoPath);\n\t\t\treturn [];\n\t\t}\n\n\t\tconst types = this._cache.applyRepositoryChanges(\n\t\t\trepoPath,\n\t\t\tchanges,\n\t\t\t'evict',\n\t\t\theard === 'sibling' ? { worktreeOnly: true } : { announced: heard === 'all' },\n\t\t);\n\t\treturn types.length ? types : undefined;\n\t}\n\n\t/** `repoPath` and every worktree registered as sharing its repository, since a shared-ref write moves them all. */\n\tprivate getRepositoryPaths(repoPath: string): string[] {\n\t\tconst commonPath = this._cache.getCommonPath(repoPath);\n\t\treturn [...new Set([repoPath, commonPath, ...this._cache.getWorktreePaths(commonPath)])];\n\t}\n\n\tprivate _blame: BlameGitSubProvider | undefined;\n\tget blame(): BlameGitSubProvider {\n\t\treturn (this._blame ??= new BlameGitSubProvider(\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _branches: BranchesGitSubProvider | undefined;\n\tget branches(): BranchesGitSubProvider {\n\t\treturn (this._branches ??= new BranchesGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _commits: CommitsGitSubProvider | undefined;\n\tget commits(): CommitsGitSubProvider {\n\t\treturn (this._commits ??= new CommitsGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _config: ConfigGitSubProvider | undefined;\n\tget config(): ConfigGitSubProvider {\n\t\treturn (this._config ??= new ConfigGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _contributors: ContributorsGitSubProvider | undefined;\n\tget contributors(): ContributorsGitSubProvider {\n\t\treturn (this._contributors ??= new ContributorsGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _diff: DiffGitSubProvider | undefined;\n\tget diff(): DiffGitSubProvider {\n\t\treturn (this._diff ??= new DiffGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _graph: GraphGitSubProvider | undefined;\n\tget graph(): GraphGitSubProvider {\n\t\treturn (this._graph ??= new GraphGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _maintenance: MaintenanceGitSubProvider | undefined;\n\t// Optional so subclasses whose repos aren't local can report the capability as absent — see\n\t// `VslsGitProvider`. Consumers already treat `maintenance == null` as \"unsupported here\" (web builds\n\t// never register it at all).\n\tget maintenance(): MaintenanceGitSubProvider | undefined {\n\t\tif (!this._localRepositories) return undefined;\n\n\t\treturn (this._maintenance ??= new MaintenanceGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _ops: OperationsGitSubProvider | undefined;\n\tget ops(): OperationsGitSubProvider {\n\t\treturn (this._ops ??= new OperationsGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t\tthis._indexRefresher,\n\t\t));\n\t}\n\n\tprivate _patch: PatchGitSubProvider | undefined;\n\tget patch(): PatchGitSubProvider {\n\t\treturn (this._patch ??= new PatchGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _pausedOps: PausedOperationsGitSubProvider | undefined;\n\tget pausedOps(): PausedOperationsGitSubProvider {\n\t\treturn (this._pausedOps ??= new PausedOperationsGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t\tthis._indexRefresher,\n\t\t));\n\t}\n\n\tprivate _refs: RefsGitSubProvider | undefined;\n\tget refs(): RefsGitSubProvider {\n\t\treturn (this._refs ??= new RefsGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _remotes: RemotesGitSubProvider | undefined;\n\tget remotes(): RemotesGitSubProvider {\n\t\treturn (this._remotes ??= new RemotesGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _revision: RevisionGitSubProvider | undefined;\n\tget revision(): RevisionGitSubProvider {\n\t\treturn (this._revision ??= new RevisionGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _staging: StagingGitSubProvider | undefined;\n\tget staging(): StagingGitSubProvider {\n\t\treturn (this._staging ??= new StagingGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _stash: StashGitSubProvider | undefined;\n\tget stash(): StashGitSubProvider {\n\t\treturn (this._stash ??= new StashGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t\tthis._indexRefresher,\n\t\t));\n\t}\n\n\tprivate _status: StatusGitSubProvider | undefined;\n\tget status(): StatusGitSubProvider {\n\t\treturn (this._status ??= new StatusGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _tags: TagsGitSubProvider | undefined;\n\tget tags(): TagsGitSubProvider {\n\t\treturn (this._tags ??= new TagsGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _worktrees: WorktreesGitSubProvider | undefined;\n\tget worktrees(): WorktreesGitSubProvider {\n\t\treturn (this._worktrees ??= new WorktreesGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t\tthis._ignoredWorktreeFolders.length ? path => this.getIgnoredWorktreeRoots(path) : undefined,\n\t\t\tthis._indexRefresher,\n\t\t));\n\t}\n\n\tgetAbsoluteUri(pathOrUri: string | Uri, base: string | Uri): Uri {\n\t\tconst baseUri = typeof base !== 'string' ? base : fileUri(base);\n\t\tif (typeof pathOrUri !== 'string') return pathOrUri;\n\t\tif (maybeUri(pathOrUri)) return parseUri(pathOrUri);\n\t\tif (path.isAbsolute(pathOrUri)) return fileUri(pathOrUri);\n\t\treturn joinUriPath(baseUri, pathOrUri);\n\t}\n\n\tgetRelativePath(pathOrUri: string | Uri, base: string | Uri): string {\n\t\tconst [relativePath] = splitPath(toFsPath(pathOrUri), toFsPath(base));\n\t\treturn relativePath;\n\t}\n\n\tasync excludeIgnoredUris(repoPath: string, uris: Uri[]): Promise<Uri[]> {\n\t\tconst filter = this.getIgnoreFilter(repoPath);\n\t\t// Only a watcher refreshes the filter, and nothing may be watching this repository\n\t\tvoid filter.revalidate();\n\t\tawait filter.ready();\n\t\treturn uris.filter(uri => {\n\t\t\tconst relativePath = normalizePath(path.relative(repoPath, toFsPath(uri)));\n\t\t\treturn !relativePath || !filter.isIgnored(relativePath);\n\t\t});\n\t}\n\n\tasync getIgnoredUrisFilter(repoPath: string): Promise<(uri: Uri) => boolean> {\n\t\tconst filter = this.getIgnoreFilter(repoPath);\n\t\tvoid filter.revalidate();\n\t\tawait filter.ready();\n\t\treturn (uri: Uri) => {\n\t\t\tconst relativePath = normalizePath(path.relative(repoPath, toFsPath(uri)));\n\t\t\treturn relativePath ? filter.isIgnored(relativePath) : false;\n\t\t};\n\t}\n\n\tasync getLastFetchedTimestamp(repoPath: string): Promise<number | undefined> {\n\t\treturn this._cache.getLastFetchedTimestamp(repoPath, async (commonPath): Promise<number | undefined> => {\n\t\t\tconst gitDir = await this.config.getGitDir?.(commonPath).catch(() => undefined);\n\t\t\tif (gitDir == null) return undefined;\n\n\t\t\tconst gitDirUri = gitDir.commonUri ?? gitDir.uri;\n\t\t\tconst fetchHeadUri = joinUriPath(gitDirUri, 'FETCH_HEAD');\n\t\t\tconst stats = await this.context.fs.stat(fetchHeadUri);\n\t\t\t// If the file is empty, assume the fetch failed, and don't update the timestamp\n\t\t\tif (stats != null && stats.size > 0) return stats.mtime;\n\n\t\t\treturn undefined;\n\t\t});\n\t}\n\n\tgetIgnoreFilter(repoPath: string): GitIgnoreFilter {\n\t\tlet filter = this._cache.gitIgnore.get(repoPath);\n\t\tif (filter == null) {\n\t\t\tconst gitDir = this._cache.gitDir.get(repoPath);\n\t\t\tconst gitDirPath = gitDir?.uri.fsPath ?? `${repoPath}/.git`;\n\t\t\tfilter = new GitIgnoreFilter({\n\t\t\t\trepoPath: repoPath,\n\t\t\t\tgitDirPath: gitDirPath,\n\t\t\t\tfs: this.context.fs,\n\t\t\t\tgetConfig: async () => {\n\t\t\t\t\tawait this._cache.ensureRegistered(repoPath);\n\t\t\t\t\tconst env = this._git.getRunEnvironment();\n\t\t\t\t\tconst { excludesFile, ignoreCase } = await this.config.getIgnoreConfig(repoPath);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tglobalExcludesPath:\n\t\t\t\t\t\t\texcludesFile == null\n\t\t\t\t\t\t\t\t? getDefaultGlobalExcludesPath(env)\n\t\t\t\t\t\t\t\t: resolveGitPathConfig(excludesFile, repoPath, env),\n\t\t\t\t\t\tignoreCase: parseIgnoreCase(ignoreCase),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t// `info/exclude` lives in the COMMON git dir — a linked worktree's own git dir has none\n\t\t\t\tgetInfoExcludePath: async () => {\n\t\t\t\t\tconst gitDir = await this.config.getGitDir?.(repoPath);\n\t\t\t\t\tif (gitDir == null) return undefined;\n\n\t\t\t\t\treturn `${(gitDir.commonUri ?? gitDir.uri).fsPath}/info/exclude`;\n\t\t\t\t},\n\t\t\t\tinvalidateConfig: () => this._cache.deleteIgnoreConfig(repoPath),\n\t\t\t\tgetGitIgnorePaths: () => this.getGitIgnorePaths(repoPath),\n\t\t\t});\n\t\t\tthis._cache.gitIgnore.set(repoPath, filter);\n\t\t}\n\t\treturn filter;\n\t}\n\n\tprivate async getConfigWatchPaths(\n\t\trepoPath: string,\n\t\tenv: Readonly<Record<string, string | undefined>>,\n\t): Promise<readonly string[] | undefined> {\n\t\tconst cached = this._configWatchPaths.get(env);\n\t\tif (cached != null) return cached;\n\n\t\t// KEEP: git var separates global candidates with LF and has no NUL-delimited output.\n\t\tif (\n\t\t\t[env.HOME, env.XDG_CONFIG_HOME, env.USERPROFILE, env.HOMEPATH, env.HOMEDRIVE].some(\n\t\t\t\tvalue => value != null && (/[\\r\\n]/.test(value) || value.split(path.sep).includes('..')),\n\t\t\t)\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst read = async (\n\t\t\tname: 'GIT_CONFIG_SYSTEM' | 'GIT_CONFIG_GLOBAL',\n\t\t\tlimit: number,\n\t\t): Promise<string[] | undefined> => {\n\t\t\tconst result = await this._git.run(\n\t\t\t\t{ cwd: repoPath, env: env, errors: 'ignore', expectedExitCodes: [1] },\n\t\t\t\t'var',\n\t\t\t\tname,\n\t\t\t);\n\t\t\tif (result.completion.status !== 'exited' || result.stderr) return undefined;\n\n\t\t\tif (result.exitCode === 1 && !result.stdout) {\n\t\t\t\tconst disabled =\n\t\t\t\t\tname === 'GIT_CONFIG_SYSTEM'\n\t\t\t\t\t\t? parseGitBoolean(env.GIT_CONFIG_NOSYSTEM)\n\t\t\t\t\t\t: env.HOME == null && !env.XDG_CONFIG_HOME;\n\t\t\t\treturn disabled ? [] : undefined;\n\t\t\t}\n\n\t\t\tconst output = isWindows ? result.stdout.replaceAll('\\r\\n', '\\n') : result.stdout;\n\t\t\tif (result.exitCode !== 0 || !output.endsWith('\\n') || /[\\r\\0\\ufffd]/.test(output)) return undefined;\n\n\t\t\tconst paths = output.slice(0, -1).split('\\n');\n\t\t\treturn paths.length <= limit && paths.every(candidate => path.isAbsolute(candidate)) ? paths : undefined;\n\t\t};\n\t\tconst pending = Promise.all([read('GIT_CONFIG_SYSTEM', 1), read('GIT_CONFIG_GLOBAL', 2)]).then(\n\t\t\t([system, global]) => (system != null && global != null ? [...new Set([...system, ...global])] : undefined),\n\t\t);\n\t\tthis._configWatchPaths.set(env, pending);\n\t\tlet paths: readonly string[] | undefined;\n\t\ttry {\n\t\t\tpaths = await pending;\n\t\t\treturn paths;\n\t\t} finally {\n\t\t\tif (paths == null) {\n\t\t\t\tthis._configWatchPaths.delete(env);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync getGitIgnoreWatchInputs(\n\t\trepoPath: string,\n\t\tgitDir: GitDir,\n\t\toptions?: { refreshConfig?: boolean },\n\t): Promise<GitIgnoreWatchInputs | undefined> {\n\t\tif (!this._localRepositories) return undefined;\n\n\t\tawait this._cache.ensureRegistered(repoPath);\n\t\tif (options?.refreshConfig) {\n\t\t\tthis._cache.deleteIgnoreConfig(repoPath);\n\t\t}\n\t\tconst gitEnv = this._git.getRunEnvironment();\n\t\tif (\n\t\t\tisGitDirMovedByEnv(gitEnv) ||\n\t\t\tgitEnv.GIT_INDEX_FILE != null ||\n\t\t\tgitEnv.GIT_CONFIG != null ||\n\t\t\tgitEnv.GIT_CONFIG_GLOBAL != null ||\n\t\t\tgitEnv.GIT_CONFIG_SYSTEM != null ||\n\t\t\tignoreConfigOverrideRegex.test(gitEnv.GIT_CONFIG_PARAMETERS ?? '') ||\n\t\t\tObject.entries(gitEnv).some(\n\t\t\t\t([key, value]) => key.startsWith('GIT_CONFIG_KEY_') && ignoreConfigOverrideRegex.test(value ?? ''),\n\t\t\t)\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst config = await this.config.getIgnoreConfig(repoPath, { observableOnly: true });\n\t\tif (config == null) return undefined;\n\n\t\tconst ignoreCase = parseIgnoreCase(config.ignoreCase);\n\t\tif (config.ignoreCase != null && ignoreCase == null) return undefined;\n\n\t\tif (\n\t\t\tconfig.excludesFile?.startsWith('%(prefix)/') ||\n\t\t\t(config.excludesFile?.startsWith('~') &&\n\t\t\t\tconfig.excludesFile !== '~' &&\n\t\t\t\t!config.excludesFile.startsWith('~/'))\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst commonGitDirPath = (gitDir.commonUri ?? gitDir.uri).fsPath;\n\t\tconst excludesFilePath =\n\t\t\tconfig.excludesFile == null\n\t\t\t\t? getDefaultGlobalExcludesPath(gitEnv)\n\t\t\t\t: resolveGitPathConfig(config.excludesFile, repoPath, gitEnv);\n\t\tif (\n\t\t\t!path.isAbsolute(commonGitDirPath) ||\n\t\t\t(config.excludesFile != null && excludesFilePath == null) ||\n\t\t\t(excludesFilePath != null && !path.isAbsolute(excludesFilePath))\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst configWatchPaths = await this.getConfigWatchPaths(repoPath, gitEnv);\n\t\tif (configWatchPaths == null) return undefined;\n\n\t\tconst sharedIndex = await this._git.run(\n\t\t\t{ cwd: repoPath, env: gitEnv, errors: 'throw' },\n\t\t\t'rev-parse',\n\t\t\t'--shared-index-path',\n\t\t);\n\t\tif (sharedIndex.completion.status !== 'exited' || sharedIndex.exitCode !== 0 || sharedIndex.stdout.trim()) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst tracked = await this._git.run(\n\t\t\t{ cwd: repoPath, env: gitEnv, errors: 'throw', maxBuffer: maxProtectedWatchListingBytes },\n\t\t\t'ls-files',\n\t\t\t'-z',\n\t\t\t'--cached',\n\t\t\t'--ignored',\n\t\t\t'--exclude-standard',\n\t\t\t'--stage',\n\t\t);\n\t\tif (\n\t\t\ttracked.completion.status !== 'exited' ||\n\t\t\ttracked.exitCode !== 0 ||\n\t\t\ttracked.stderr ||\n\t\t\ttracked.stdout.includes('\\ufffd')\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst protectedPaths = new Set<string>();\n\t\tconst ancestors = new Set<string>();\n\t\tfor (const record of iterateByDelimiter(tracked.stdout, '\\0')) {\n\t\t\tif (!record) continue;\n\n\t\t\tconst separator = record.indexOf('\\t');\n\t\t\tif (separator === -1) return undefined;\n\n\t\t\tconst entry = record.substring(separator + 1);\n\t\t\tprotectedPaths.add(entry);\n\t\t\tif (record.startsWith('160000 ')) {\n\t\t\t\tancestors.add(`${entry}/`);\n\t\t\t}\n\t\t\tfor (let slash = entry.indexOf('/'); slash !== -1; slash = entry.indexOf('/', slash + 1)) {\n\t\t\t\tancestors.add(entry.substring(0, slash + 1));\n\t\t\t}\n\t\t\tif (protectedPaths.size + ancestors.size > maxProtectedWatchPaths) return undefined;\n\t\t}\n\n\t\tconst protectedDirectories = new Set<string>();\n\t\tif (ancestors.size !== 0) {\n\t\t\tconst refused = await this.checkIgnore(repoPath, [...ancestors], protectedDirectories, { noIndex: true });\n\t\t\tif (refused != null) return undefined;\n\t\t}\n\n\t\tif (gitEnv !== this._git.getRunEnvironment()) return undefined;\n\n\t\treturn {\n\t\t\tinfoExcludePath: path.join(commonGitDirPath, 'info', 'exclude'),\n\t\t\texcludesFilePath: excludesFilePath ?? null,\n\t\t\tignoreCase: ignoreCase ?? false,\n\t\t\tconfigWatchPaths: configWatchPaths,\n\t\t\tprotectedPaths: [...protectedPaths].sort(),\n\t\t\tprotectedDirectories: Array.from(protectedDirectories, directory => directory.slice(0, -1)).sort(),\n\t\t};\n\t}\n\n\tasync getIgnoredDirectories(repoPath: string, cancellation?: AbortSignal): Promise<string[]> {\n\t\t// `--directory` collapses a directory to one entry when everything in it is ignored — which includes\n\t\t// directories no rule matches whose current contents merely happen to be ignored (a `logs/` holding only\n\t\t// `*.log` files under a `*.log` rule), so each candidate is confirmed against the rules below\n\t\tconst listed = await this._git.run(\n\t\t\t{ cwd: repoPath, errors: 'throw', cancellation: cancellation },\n\t\t\t'ls-files',\n\t\t\t'-z',\n\t\t\t'--others',\n\t\t\t'--ignored',\n\t\t\t'--exclude-standard',\n\t\t\t'--directory',\n\t\t);\n\n\t\tconst candidates: string[] = [];\n\t\tfor (const entry of iterateByDelimiter(listed.stdout, '\\0')) {\n\t\t\tif (entry.length > 1 && entry.endsWith('/')) {\n\t\t\t\tcandidates.push(entry);\n\t\t\t}\n\t\t}\n\t\tif (!candidates.length) return [];\n\n\t\tconst confirmed = await this.getIgnoredPaths(repoPath, candidates, undefined, cancellation);\n\n\t\tconst directories: string[] = [];\n\t\tfor (const entry of confirmed) {\n\t\t\t// Never `.git` itself, and no name a watcher would read as a pattern\n\t\t\tif (entry.length < 2 || !entry.endsWith('/') || /[*?[\\]{}()!+@\\\\]/.test(entry)) continue;\n\n\t\t\tconst directory = entry.substring(0, entry.length - 1);\n\t\t\tif (directory === '.git') continue;\n\n\t\t\tdirectories.push(directory);\n\t\t}\n\n\t\t// A path sorts after every prefix of it, so an entry's ancestors have already been kept (or not) by the time it\n\t\t// is checked — and the kept set comes out sorted\n\t\tdirectories.sort();\n\n\t\tconst kept = new Set<string>();\n\t\tfor (const directory of directories) {\n\t\t\tlet beneathKept = false;\n\t\t\tfor (let i = directory.indexOf('/'); i !== -1; i = directory.indexOf('/', i + 1)) {\n\t\t\t\tif (kept.has(directory.substring(0, i))) {\n\t\t\t\t\tbeneathKept = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!beneathKept) {\n\t\t\t\tkept.add(directory);\n\t\t\t}\n\t\t}\n\n\t\treturn [...kept];\n\t}\n\n\tasync getIgnoredEntries(\n\t\trepoPath: string,\n\t\toptions?: { paths?: readonly string[]; priority?: GitCommandPriority },\n\t\tcancellation?: AbortSignal,\n\t): Promise<string[]> {\n\t\tlet paths = options?.paths;\n\t\t// No pathspec means \"everything\" to git, which is not what an empty list asks for\n\t\tif (paths != null && !paths.length) return [];\n\n\t\t// A scope inside an ignored folder makes git list the folder itself, or fail outright, so a scope that is\n\t\t// itself ignored is answered here, as one entry, and left out of the listing\n\t\tconst scopedEntries = new Set<string>();\n\t\tif (paths != null) {\n\t\t\tconst scopes = [...new Set(paths.map(p => (p.length > 1 ? trimTrailingSlashes(p) : p)))];\n\t\t\tconst ignoredScopes = await this.getIgnoredScopes(\n\t\t\t\trepoPath,\n\t\t\t\tscopes.filter(p => p !== ''),\n\t\t\t\toptions?.priority,\n\t\t\t\tcancellation,\n\t\t\t);\n\n\t\t\tconst ignored = [...ignoredScopes];\n\t\t\t// `lstat`, as git lists a symlink as a file even when it points at a folder\n\t\t\tconst listed = await Promise.allSettled(\n\t\t\t\tignored.map(async scope => {\n\t\t\t\t\tconst fullPath = path.join(repoPath, scope);\n\t\t\t\t\tif (!(await fs.lstat(fullPath)).isDirectory()) return scope;\n\n\t\t\t\t\treturn (await hasNonDirectoryEntry(fullPath)) ? `${scope}/` : undefined;\n\t\t\t\t}),\n\t\t\t);\n\t\t\tfor (const result of listed) {\n\t\t\t\t// Not on disk, so nothing is ignored there\n\t\t\t\tif (result.status === 'fulfilled' && result.value != null) {\n\t\t\t\t\tscopedEntries.add(result.value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpaths = scopes.filter(p => !ignoredScopes.has(p));\n\t\t\tif (!paths.length) return [...scopedEntries].sort();\n\t\t}\n\n\t\t// `status --ignored` walks every ignored tree, and `ls-files --directory` drops the ignored entries inside a\n\t\t// new untracked folder, so status is asked only about those folders\n\t\tconst args = ['ls-files', '-z', '--others', '--exclude-standard', '--directory', '--no-empty-directory'];\n\t\tconst runOptions = {\n\t\t\tcwd: repoPath,\n\t\t\terrors: 'throw',\n\t\t\tcancellation: cancellation,\n\t\t\tpriority: options?.priority,\n\t\t} as const;\n\n\t\tconst readListing = async (extra: readonly string[]): Promise<Set<string>> => {\n\t\t\tconst listed = new Set<string>();\n\t\t\tconst prefix = [...args, ...extra];\n\t\t\tfor (const batch of paths != null ? batchLiteralPathspecs(paths, prefix) : [undefined]) {\n\t\t\t\tconst result = await this._git.run(runOptions, ...prefix, ...(batch != null ? ['--', ...batch] : []));\n\t\t\t\tfor (const entry of iterateByDelimiter(result.stdout, '\\0')) {\n\t\t\t\t\tif (entry !== '') {\n\t\t\t\t\t\tlisted.add(entry);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn listed;\n\t\t};\n\n\t\tconst [ignoredResult, untrackedResult] = await Promise.allSettled([\n\t\t\treadListing(['--ignored']),\n\t\t\treadListing([]),\n\t\t]);\n\t\tif (ignoredResult.status === 'rejected') throw ignoredResult.reason;\n\t\tif (untrackedResult.status === 'rejected') throw untrackedResult.reason;\n\n\t\tconst entries = new Set<string>(scopedEntries);\n\t\tfor (const entry of ignoredResult.value) {\n\t\t\tif (entry !== '.git/') {\n\t\t\t\tentries.add(entry);\n\t\t\t}\n\t\t}\n\n\t\tconst folders: string[] = [];\n\t\tfor (const entry of untrackedResult.value) {\n\t\t\tif (entry.endsWith('/')) {\n\t\t\t\tfolders.push(entry);\n\t\t\t}\n\t\t}\n\t\tif (!folders.length) return [...entries].sort();\n\n\t\t// `matching` reports a folder an ignore rule matches without walking it, but lists each file of a folder that is\n\t\t// ignored only because all of its files are, so `all` untracked files are needed to fold those back\n\t\tconst matching = await this._git.supports('git:status:ignored-matching');\n\t\tconst prefix = [\n\t\t\t'status',\n\t\t\t'--porcelain',\n\t\t\t'-z',\n\t\t\tmatching ? '--ignored=matching' : '--ignored',\n\t\t\tmatching ? '--untracked-files=all' : '--untracked-files=normal',\n\t\t\t'--ignore-submodules=all',\n\t\t];\n\n\t\tconst records: string[] = [];\n\t\tfor (const batch of batchLiteralPathspecs(folders, prefix)) {\n\t\t\tconst listed = await this._git.run(\n\t\t\t\t{\n\t\t\t\t\t...runOptions,\n\t\t\t\t\tconfigs: [...gitConfigsStatus, '-c', 'status.renames=false'],\n\t\t\t\t\tenv: { GIT_OPTIONAL_LOCKS: '0' },\n\t\t\t\t},\n\t\t\t\t...prefix,\n\t\t\t\t'--',\n\t\t\t\t...batch,\n\t\t\t);\n\n\t\t\t// Only untracked folders are in scope, so there are no tracked entries, and no rename pairs, to step over\n\t\t\tfor (const record of iterateByDelimiter(listed.stdout, '\\0')) {\n\t\t\t\tif (matching) {\n\t\t\t\t\trecords.push(record);\n\t\t\t\t} else if (record.startsWith('!! ')) {\n\t\t\t\t\tentries.add(record.substring(3));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (matching) {\n\t\t\tfor (const entry of foldMatchingIgnored(records)) {\n\t\t\t\tentries.add(entry);\n\t\t\t}\n\t\t}\n\t\treturn [...entries].sort();\n\t}\n\n\t/**\n\t * Which of `scopes` are ignored. A scope git refuses (beyond a symlink, inside a submodule) is not ignored, as the\n\t * listing answers it with nothing. Any other failure answers none; when git itself is failing, the listing that\n\t * follows fails too.\n\t */\n\tprivate async getIgnoredScopes(\n\t\trepoPath: string,\n\t\tscopes: readonly string[],\n\t\tpriority: GitCommandPriority | undefined,\n\t\tcancellation: AbortSignal | undefined,\n\t): Promise<Set<string>> {\n\t\ttry {\n\t\t\treturn await this.getIgnoredPaths(repoPath, scopes, { priority: priority }, cancellation);\n\t\t} catch (ex) {\n\t\t\tif (isCancellationError(ex)) throw ex;\n\n\t\t\treturn new Set();\n\t\t}\n\t}\n\n\tasync getIgnoredPaths(\n\t\trepoPath: string,\n\t\tpaths: readonly string[],\n\t\toptions?: { priority?: GitCommandPriority },\n\t\tcancellation?: AbortSignal,\n\t): Promise<Set<string>> {\n\t\tconst ignored = new Set<string>();\n\t\tconst ambiguous = new Set<string>();\n\t\tawait this.collectIgnoredPaths(repoPath, paths, ignored, options, cancellation, ambiguous);\n\t\tif (ambiguous.size) {\n\t\t\t// KEEP: check-ignore rejects :(literal), and a wildcard matching an unrelated index entry can mask an ignore rule.\n\t\t\tawait this.collectIgnoredPaths(\n\t\t\t\trepoPath,\n\t\t\t\t[...ambiguous],\n\t\t\t\tignored,\n\t\t\t\t{ ...options, noIndex: true },\n\t\t\t\tcancellation,\n\t\t\t);\n\t\t}\n\t\tif (!ignored.size) return ignored;\n\n\t\tconst names = new Map<string, string>();\n\t\tfor (const match of ignored) {\n\t\t\tnames.set(match, path.relative(repoPath, path.resolve(repoPath, match)).split(path.sep).join('/'));\n\t\t}\n\t\tconst untracked = new Set(names.values());\n\t\tconst untrackedIgnoringCase = new Set(Array.from(untracked, foldGitPathCase));\n\t\tconst prefix = ['ls-files', '-z', '--cached'];\n\t\tconst runOptions = {\n\t\t\tcwd: repoPath,\n\t\t\terrors: 'throw',\n\t\t\tcancellation: cancellation,\n\t\t\tpriority: options?.priority,\n\t\t} as const;\n\t\tfor (const batch of batchLiteralPathspecs([...ignored], prefix)) {\n\t\t\tconst result = await this._git.run(\n\t\t\t\t{ ...runOptions, env: { GIT_ICASE_PATHSPECS: '1' } },\n\t\t\t\t...prefix,\n\t\t\t\t'--',\n\t\t\t\t...batch,\n\t\t\t);\n\t\t\tfor (const indexed of iterateByDelimiter(result.stdout, '\\0')) {\n\t\t\t\tfor (let name = indexed; name; name = name.substring(0, name.lastIndexOf('/'))) {\n\t\t\t\t\tuntracked.delete(name);\n\t\t\t\t\tuntrackedIgnoringCase.delete(foldGitPathCase(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet ignoreCase: boolean | undefined;\n\t\tfor (const [original, name] of names) {\n\t\t\tif (!untracked.has(name)) {\n\t\t\t\tignored.delete(original);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (untrackedIgnoringCase.has(foldGitPathCase(name))) continue;\n\n\t\t\tif (ignoreCase == null) {\n\t\t\t\tconst result = await this._git.run(\n\t\t\t\t\t{ ...runOptions, expectedExitCodes: [1] },\n\t\t\t\t\t'config',\n\t\t\t\t\t'--bool',\n\t\t\t\t\t'--get',\n\t\t\t\t\t'core.ignorecase',\n\t\t\t\t);\n\t\t\t\tignoreCase = result.stdout.trim() === 'true';\n\t\t\t}\n\t\t\tif (ignoreCase) {\n\t\t\t\tignored.delete(original);\n\t\t\t}\n\t\t}\n\t\treturn ignored;\n\t}\n\n\tprivate async collectIgnoredPaths(\n\t\trepoPath: string,\n\t\tpaths: readonly string[],\n\t\tignored: Set<string>,\n\t\toptions?: { priority?: GitCommandPriority; noIndex?: boolean },\n\t\tcancellation?: AbortSignal,\n\t\tambiguous?: Set<string>,\n\t): Promise<void> {\n\t\tlet pending = paths;\n\t\twhile (pending.length) {\n\t\t\tconst refused = await this.checkIgnore(repoPath, pending, ignored, options, cancellation, ambiguous);\n\t\t\tif (refused == null) break;\n\n\t\t\tconst folder = refused.folderWide ? getRefusedFolder(pending[refused.index]) : undefined;\n\t\t\tpending = pending.slice(refused.index + 1);\n\t\t\tif (folder != null) {\n\t\t\t\tpending = pending.filter(p => !p.startsWith(folder) || hasDotSegment(p));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * One `check-ignore` run over `paths`, adding the ignored ones to `ignored`. Returns the path git died on, which\n\t * every path before it was answered ahead of, or `undefined` when all were answered.\n\t */\n\tprivate async checkIgnore(\n\t\trepoPath: string,\n\t\tpaths: readonly string[],\n\t\tignored: Set<string>,\n\t\toptions?: { priority?: GitCommandPriority; noIndex?: boolean },\n\t\tcancellation?: AbortSignal,\n\t\tambiguous?: Set<string>,\n\t): Promise<{ index: number; folderWide: boolean } | undefined> {\n\t\tconst lines = paths.map(p => (p.startsWith(':') ? `./${p}` : p));\n\n\t\tlet stdout: string;\n\t\tlet refusal: GitError | undefined;\n\t\ttry {\n\t\t\t// `-v -n` writes a record for every path answered, so the records line up with `paths` and end where git died\n\t\t\tconst result = await this._git.run(\n\t\t\t\t{\n\t\t\t\t\tcwd: repoPath,\n\t\t\t\t\terrors: 'throw',\n\t\t\t\t\tcancellation: cancellation,\n\t\t\t\t\tpriority: options?.priority,\n\t\t\t\t\tstdin: `${lines.join('\\0')}\\0`,\n\t\t\t\t\texpectedExitCodes: [1],\n\t\t\t\t},\n\t\t\t\t'check-ignore',\n\t\t\t\t...(options?.noIndex ? ['--no-index'] : []),\n\t\t\t\t'-v',\n\t\t\t\t'-n',\n\t\t\t\t'-z',\n\t\t\t\t'--stdin',\n\t\t\t);\n\t\t\tstdout = result.stdout;\n\t\t} catch (ex) {\n\t\t\tif (!(ex instanceof GitError) || ex.stderr == null || !GitErrors.pathspecRefused.test(ex.stderr)) throw ex;\n\n\t\t\trefusal = ex;\n\t\t\tstdout = ex.stdout ?? '';\n\t\t}\n\n\t\t// Each record is source, line number, pattern and path; the pattern is empty when none matched, and `!`-prefixed\n\t\t// when it re-includes the path\n\t\tlet index = 0;\n\t\tlet field = 0;\n\t\tlet pattern = '';\n\t\tfor (const value of iterateByDelimiter(stdout, '\\0')) {\n\t\t\tif (field === 2) {\n\t\t\t\tpattern = value;\n\t\t\t} else if (field === 3) {\n\t\t\t\tconst name = paths[index++];\n\t\t\t\tif (name != null && pattern && !pattern.startsWith('!')) {\n\t\t\t\t\tignored.add(name);\n\t\t\t\t} else if (name != null && !pattern && ambiguous != null && /[*?[\\\\]/.test(name)) {\n\t\t\t\t\tambiguous.add(name);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfield = (field + 1) % 4;\n\t\t}\n\n\t\tif (refusal == null) return undefined;\n\t\t// Every path answered yet git still died, so the refusal can't be pinned to one of them\n\t\tif (index >= paths.length) throw refusal;\n\n\t\treturn { index: index, folderWide: /is (?:beyond a symbolic link|in submodule)/i.test(refusal.stderr ?? '') };\n\t}\n\n\t/** Every `.gitignore` git reads in the working tree (tracked, or untracked and not itself ignored), root included */\n\tprivate async getGitIgnorePaths(repoPath: string): Promise<string[]> {\n\t\tconst result = await this._git.run(\n\t\t\t{ cwd: repoPath, errors: 'throw' },\n\t\t\t'ls-files',\n\t\t\t'-z',\n\t\t\t'--cached',\n\t\t\t'--others',\n\t\t\t'--exclude-standard',\n\t\t\t'--',\n\t\t\t':(glob)**/.gitignore',\n\t\t);\n\n\t\tconst paths: string[] = [];\n\t\tfor (const line of iterateByDelimiter(result.stdout, '\\0')) {\n\t\t\tif (!line.length) continue;\n\n\t\t\tpaths.push(line);\n\t\t}\n\t\treturn paths;\n\t}\n\n\tprivate async isTrackedWithDetails(\n\t\tfilePath: string,\n\t\trepoPath: string,\n\t\trev?: string,\n\t): Promise<{ path: string; status?: GitFileStatus; originalPath?: string } | undefined> {\n\t\tif (rev === deletedOrMissing) return undefined;\n\n\t\tconst scope = getScopedLogger();\n\n\t\ttry {\n\t\t\tconst [relativePath, root] = splitPath(filePath, repoPath);\n\n\t\t\t// Check if the file exists in the working tree first (better cache reuse)\n\t\t\tlet tracked = await this.revision.exists(root, relativePath);\n\t\t\tif (tracked) return { path: relativePath };\n\n\t\t\t// If a specific revision was provided, check there too\n\t\t\tif (rev && !isUncommitted(rev)) {\n\t\t\t\ttracked = await this.revision.exists(root, relativePath, rev);\n\t\t\t\tif (!tracked) {\n\t\t\t\t\t// Check the parent revision (file might have been deleted in this rev)\n\t\t\t\t\ttracked = await this.revision.exists(root, relativePath, `${rev}^`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn tracked ? { path: relativePath } : undefined;\n\t\t} catch (ex) {\n\t\t\tscope?.error(ex);\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tthis._unregisterListener.dispose();\n\t\tthis._resetListener.dispose();\n\t\tthis._onDidAnnounceChanges.dispose();\n\t\tthis._indexRefresher.dispose();\n\t\tthis._git.dispose();\n\t\tif (this._cacheOwned) {\n\t\t\tthis._cache.dispose();\n\t\t}\n\t}\n}\n\n/**\n * The names in `refs` a sibling worktree hears with the shared part of `changes`: those of a shared ref kind among\n * `changes`. An empty `changes` or `'unknown'` reaches siblings as every shared kind, unnamed, so none.\n */\nfunction getSharedRefs(changes: readonly RepositoryChange[], refs: readonly string[]): string[] | undefined {\n\tif (!changes.length || changes.includes('unknown')) return undefined;\n\n\tconst shared = refs.filter(r => {\n\t\tif (!r.startsWith('refs/')) return false;\n\n\t\tconst kind = getRefChangeKind(r);\n\t\treturn kind != null && changes.includes(kind) && worktreeSharedChanges.has(kind);\n\t});\n\treturn shared.length ? shared : undefined;\n}\n\n/**\n * Resolves a pathname config value the way git does: a leading `~/` (or a bare `~`) is the home directory, and a\n * relative path is taken from the repository root. Done here rather than with `git config --type=path`, which needs\n * git 2.18, newer than the minimum supported version.\n */\nfunction resolveGitPathConfig(\n\tvalue: string,\n\trepoPath: string,\n\tgitEnv: Readonly<Record<string, string | undefined>>,\n): string | undefined {\n\tif (value === '~' || value.startsWith('~/')) {\n\t\tconst home = gitEnv.HOME;\n\t\tif (home == null) return undefined;\n\t\tif (value === '~') return home || undefined;\n\n\t\treturn path.join(home || path.sep, value.substring(2));\n\t}\n\n\treturn path.resolve(repoPath, value);\n}\n\nfunction parseIgnoreCase(value: string | undefined): boolean | undefined {\n\tif (value == null) return undefined;\n\tif (parseGitBoolean(value)) return true;\n\n\treturn isGitBooleanFalse(value) ? false : undefined;\n}\n\nfunction foldGitPathCase(name: string): string {\n\t// KEEP: Git's C-locale pathspec matching folds only ASCII.\n\treturn name.replace(/[A-Z]/g, c => c.toLowerCase());\n}\n\n/** Where git reads global excludes when `core.excludesFile` is unset: `$XDG_CONFIG_HOME/git/ignore`, else `$HOME/.config/git/ignore` */\nfunction getDefaultGlobalExcludesPath(gitEnv: Readonly<Record<string, string | undefined>>): string | undefined {\n\tconst xdgConfigHome = gitEnv.XDG_CONFIG_HOME;\n\tif (xdgConfigHome) return path.join(xdgConfigHome, 'git', 'ignore');\n\n\tconst home = gitEnv.HOME ?? (isWindows ? homedir() : undefined);\n\treturn home == null ? undefined : path.join(home || path.sep, '.config', 'git', 'ignore');\n}\n\n/**\n * The folder of a path git refused for a symlink or submodule in its leading folders, where every other path is refused\n * too; none for a top-level path, or one with `.` or `..` segments, whose folder git would read otherwise\n */\nfunction getRefusedFolder(refused: string): string | undefined {\n\tconst trimmed = trimTrailingSlashes(refused);\n\tif (hasDotSegment(trimmed)) return undefined;\n\n\tconst index = trimmed.lastIndexOf('/');\n\treturn index > 0 ? trimmed.substring(0, index + 1) : undefined;\n}\n\nfunction hasDotSegment(p: string): boolean {\n\treturn /(?:^|\\/)\\.\\.?(?:\\/|$)/.test(p);\n}\n\n/** Whether a folder holds a file or symlink anywhere below it, as git lists no folder without one; an unreadable folder holds none */\nasync function hasNonDirectoryEntry(folder: string): Promise<boolean> {\n\tconst pending = [folder];\n\twhile (pending.length) {\n\t\tconst current = pending.pop()!;\n\t\ttry {\n\t\t\tfor (const entry of await fs.readdir(current, { withFileTypes: true })) {\n\t\t\t\tif (!entry.isDirectory()) return true;\n\n\t\t\t\tpending.push(path.join(current, entry.name));\n\t\t\t}\n\t\t} catch {}\n\t}\n\treturn false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,MAAM,gCAAgC;AACtC,MAAM,yBAAyB;AAC/B,MAAM,gCAAgC;AACtC,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;AAqElC,IAAa,iBAAb,MAAmD;CAClD,aAA6C;EAAE,IAAI;EAAO,MAAM;EAAO,SAAS;CAAM;CAEtF;CACA;CACA;CAEA;;CAEA;CACA;CACA;;CAEA,wCAAyC,IAAI,IAAwC;CACrF,oCAAqC,IAAI,QAGvC;CACF;CACA;CACA;CAEA,YAAY,SAAgC;EAK3C,MAAM,YAAY,QAAQ,QAAQ;EAClC,KAAK,aAAa;EAClB,KAAK,UAAU;GACd,GAAG,QAAQ;GACX,OAAO;IACN,GAAG;IACH,OAAO;KACN,GAAG,WAAW;KACd,UAAU,UAAU,GAAG,UAAU;MAChC,KAAK,OAAO,YAAY,UAAU,GAAG,KAAK;MAC1C,IAAI,sBAAsB,KAAK,GAC9B,KAAK,KAAK,qBAAqB,KAAK,mBAAmB,QAAQ,CAAC;MAE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QAAkC;CACrE,MAAM,UAAU,CAAC,MAAM;CACvB,OAAO,QAAQ,QAAQ;EACtB,MAAM,UAAU,QAAQ,IAAI;EAC5B,IAAI;GACH,KAAK,MAAM,SAAS,MAAMA,SAAG,QAAQ,SAAS,EAAE,eAAe,KAAK,CAAC,GAAG;IACvE,IAAI,CAAC,MAAM,YAAY,GAAG,OAAO;IAEjC,QAAQ,KAAK,KAAK,KAAK,SAAS,MAAM,IAAI,CAAC;GAC5C;EACD,QAAQ,CAAC;CACV;CACA,OAAO;AACR"}
1
+ {"version":3,"file":"cliGitProvider.js","names":["fs"],"sources":["../../../git-cli/src/cliGitProvider.ts"],"sourcesContent":["import { promises as fs } from 'node:fs';\nimport { homedir } from 'node:os';\nimport * as path from 'node:path';\nimport type { CachedGitTypes, MergeTargetsChangeEvent } from '@gitlens/git/cache.js';\nimport { Cache, resetDropsPendingRuns } from '@gitlens/git/cache.js';\nimport type { GitServiceContext } from '@gitlens/git/context.js';\nimport type { GitFileStatus } from '@gitlens/git/models/fileStatus.js';\nimport type { GitDir, RepositoryChange } from '@gitlens/git/models/repository.js';\nimport { deletedOrMissing } from '@gitlens/git/models/revision.js';\nimport type { GitOperationRunOptions } from '@gitlens/git/providers/operations.js';\nimport type {\n\tAnnouncedRepositoryChanges,\n\tGitProvider,\n\tGitProviderDescriptor,\n} from '@gitlens/git/providers/provider.js';\nimport type { GitCommandPriority } from '@gitlens/git/run.types.js';\nimport { parseGitRemoteUrl } from '@gitlens/git/utils/remote.utils.js';\nimport { isUncommitted } from '@gitlens/git/utils/revision.utils.js';\nimport { getRefChangeKind } from '@gitlens/git/watching/changeEvent.js';\nimport { GitIgnoreFilter } from '@gitlens/git/watching/gitIgnoreFilter.js';\nimport type { GitIgnoreWatchInputs } from '@gitlens/git/watching/provider.js';\nimport { sanitizeIgnoredWorktreeFolders } from '@gitlens/git/watching/watcherPatterns.js';\nimport { isCancellationError } from '@gitlens/utils/cancellation.js';\nimport type { Event } from '@gitlens/utils/event.js';\nimport { Emitter } from '@gitlens/utils/event.js';\nimport { getScopedLogger } from '@gitlens/utils/logger.scoped.js';\nimport { joinPaths, maybeUri, normalizePath, splitPath, trimTrailingSlashes } from '@gitlens/utils/path.js';\nimport { isWindows } from '@gitlens/utils/platform.js';\nimport { cancellable } from '@gitlens/utils/promise.js';\nimport { iterateByDelimiter } from '@gitlens/utils/string.js';\nimport type { Uri } from '@gitlens/utils/uri.js';\nimport { fileUri, joinUriPath, parseUri, toFsPath } from '@gitlens/utils/uri.js';\nimport { worktreeSharedChanges } from './exec/commandClassifier.js';\nimport { fsExists } from './exec/exec.js';\nimport type { FilteredGitFeatures, GitFeatureOrPrefix, GitFeatures } from './exec/features.js';\nimport type { GitFeatureUnsupportedMessage, GitOptions, NamedRefs } from './exec/git.js';\nimport { batchLiteralPathspecs, Git, gitConfigsStatus, GitError, GitErrors } from './exec/git.js';\nimport { isGitDirMovedByEnv } from './exec/gitDirResolver.js';\nimport { readCommonGitDir, readHeadState } from './exec/headState.js';\nimport type { IndexRefresherOptions } from './exec/indexRefresh.js';\nimport { IndexRefresher } from './exec/indexRefresh.js';\nimport type { GitLocation } from './exec/locator.js';\nimport { foldMatchingIgnored } from './parsers/statusParser.js';\nimport { BlameGitSubProvider } from './providers/blame.js';\nimport { BranchesGitSubProvider } from './providers/branches.js';\nimport { CommitsGitSubProvider } from './providers/commits.js';\nimport { ConfigGitSubProvider, isGitBooleanFalse, parseGitBoolean } from './providers/config.js';\nimport { ContributorsGitSubProvider } from './providers/contributors.js';\nimport { DiffGitSubProvider } from './providers/diff.js';\nimport { GraphGitSubProvider } from './providers/graph.js';\nimport { MaintenanceGitSubProvider } from './providers/maintenance.js';\nimport { OperationsGitSubProvider } from './providers/operations.js';\nimport { PatchGitSubProvider } from './providers/patch.js';\nimport { PausedOperationsGitSubProvider } from './providers/pausedOperations.js';\nimport { RefsGitSubProvider } from './providers/refs.js';\nimport { RemotesGitSubProvider } from './providers/remotes.js';\nimport { RevisionGitSubProvider } from './providers/revision.js';\nimport { StagingGitSubProvider } from './providers/staging.js';\nimport { StashGitSubProvider } from './providers/stash.js';\nimport { StatusGitSubProvider } from './providers/status.js';\nimport { TagsGitSubProvider } from './providers/tags.js';\nimport { WorktreesGitSubProvider } from './providers/worktrees.js';\n\n/** How long reading the folders whose worktrees are ignored may take before it counts as failed (a hung mount) */\nconst ignoredWorktreeRootsTimeoutMs = 5000;\nconst maxProtectedWatchPaths = 4096;\nconst maxProtectedWatchListingBytes = 1024 * 1024;\nconst ignoreConfigOverrideRegex = /core\\.(?:excludesfile|ignorecase)/i;\n\nexport interface CliGitProviderOptions {\n\t/** Use an existing Cache instance, or one will be created */\n\tcache?: Cache;\n\t/** Context providing config and event bus hooks */\n\tcontext: GitServiceContext;\n\t/** Function that resolves the git binary location (path + version) */\n\tlocator: () => Promise<GitLocation>;\n\t/** Pre-built Git executor — when provided, used instead of creating a new Git from locator/options */\n\tgit?: Git;\n\t/** Git execution options (timeout, trust, queue config, hooks, etc.) */\n\tgitOptions?: GitOptions;\n\t/**\n\t * Whether repositories reached through this provider are on the LOCAL filesystem. `false` disables the\n\t * maintenance sub-provider entirely (Live Share): its probes stat local paths, and its writes are\n\t * rejected by the host's command allowlist, so inheriting it yields empty reports and swallowed\n\t * failures rather than an honest \"unsupported here\". Defaults to `true`.\n\t */\n\tlocalRepositories?: boolean;\n\t/**\n\t * Folders, relative to a repository's common git dir, whose worktrees core acts as if didn't exist: they are left out\n\t * of worktree lists, and their add, remove, lock, unlock or move run through `notify: 'infer'`, and the watcher's\n\t * reports of their admin entries, raise no `worktrees` change. The typed worktree writes still announce one. A host\n\t * registers one for a tool's throwaway worktrees, which no host shows (sync-tools' `sync-tools-worktrees`, for one).\n\t * Nothing else is ignored, since a user may keep real worktrees anywhere, the git dir included. A folder that isn't\n\t * a literal path strictly inside the common git dir, or that lies under `worktrees`, is dropped.\n\t */\n\tignoredWorktreeFolders?: readonly string[];\n\t/**\n\t * Refreshes a checkout's index in the background after core's own clone, worktree add, checkout, restore, merge, pull,\n\t * reset, cherry-pick, revert, rebase, stash apply, pop and push, and abort or continue of a paused operation rewrote\n\t * it, so later status and diff reads stop re-hashing the files written in the index's second. A write that stops on\n\t * conflicts refreshes too, since the files it rewrote first are read the most while the conflicts are resolved. Off\n\t * by default: each costs a status of the whole checkout, worth it only where that checkout will be read again.\n\t * `scheduleIndexRefresh` runs either way.\n\t */\n\trefreshIndexAfterWrites?: boolean;\n\t/** The clock and timer behind the background index refresh, for tests; the real ones by default */\n\tindexRefresh?: Pick<IndexRefresherOptions, 'now' | 'setTimer'>;\n}\n\n/**\n * Exposes `isTrackedWithDetails` as a callable method for sub-providers.\n * The class declares it as a regular method, but TypeScript's structural\n * typing makes it inaccessible through the class type alone when consumed\n * internally — this type re-maps it to ensure sub-providers can call it.\n */\nexport type CliGitProviderInternal = Omit<CliGitProvider, 'isTrackedWithDetails'> & {\n\tisTrackedWithDetails: CliGitProvider['isTrackedWithDetails'];\n};\n\n/**\n * A fully-wired CLI-based git provider that executes git commands via `child_process`.\n * Implements both `CliGitProviderInternal` (for internal sub-provider wiring)\n * and `GitProvider` (for registration in a provider registry).\n *\n * @example\n * ```typescript\n * const provider = new CliGitProvider({\n * context: { events: myEvents },\n * locator: () => findGitPath(null),\n * gitOptions: { gitTimeout: 30000 },\n * });\n *\n * const branches = await provider.branches.getBranches(repoPath);\n * const status = await provider.status.getStatus(repoPath);\n * ```\n */\nexport class CliGitProvider implements GitProvider {\n\treadonly descriptor: GitProviderDescriptor = { id: 'git', name: 'Git', virtual: false };\n\n\tprivate readonly _cache: Cache;\n\tprivate readonly _cacheOwned: boolean;\n\tprivate readonly _git: Git;\n\n\treadonly context: GitServiceContext;\n\t/** The host's own hooks, before the provider wraps `cache.onReset` with its own clearing */\n\tprivate readonly _hostHooks: GitServiceContext['hooks'];\n\tprivate readonly _localRepositories: boolean;\n\tprivate readonly _ignoredWorktreeFolders: readonly string[];\n\t/** By common git dir, the folders whose worktrees are ignored there: a common git dir never moves while it is open */\n\tprivate readonly _ignoredWorktreeRoots = new Map<string, Promise<readonly string[]>>();\n\tprivate readonly _configWatchPaths = new WeakMap<\n\t\tReadonly<Record<string, string | undefined>>,\n\t\tPromise<readonly string[] | undefined>\n\t>();\n\tprivate readonly _indexRefresher: IndexRefresher;\n\tprivate readonly _unregisterListener: { dispose(): void };\n\tprivate readonly _resetListener: { dispose(): void };\n\n\tconstructor(options: CliGitProviderOptions) {\n\t\t// Every typed write announces itself through `onReset`, so the provider clears its own state there\n\t\t// rather than trusting each host to: a host with no handler still reads fresh after a write. A write\n\t\t// hard-evicts, so a caller after it never joins a read that started before it; watcher-driven clears\n\t\t// reach `Cache.clearCaches` directly and keep sharing in-flight reads.\n\t\tconst hostHooks = options.context.hooks;\n\t\tthis._hostHooks = hostHooks;\n\t\tthis.context = {\n\t\t\t...options.context,\n\t\t\thooks: {\n\t\t\t\t...hostHooks,\n\t\t\t\tcache: {\n\t\t\t\t\t...hostHooks?.cache,\n\t\t\t\t\tonReset: (repoPath, ...types) => {\n\t\t\t\t\t\tthis._cache.evictCaches(repoPath, ...types);\n\t\t\t\t\t\tif (resetDropsPendingRuns(types)) {\n\t\t\t\t\t\t\tthis._git.clearPendingCommands(this.getRepositoryPaths(repoPath));\n\t\t\t\t\t\t}\n\t\t\t\t\t\thostHooks?.cache?.onReset?.(repoPath, ...types);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trepository: {\n\t\t\t\t\t...hostHooks?.repository,\n\t\t\t\t\tonChanged: (repoPath, changes, refs, options) =>\n\t\t\t\t\t\tthis.announceWrite(repoPath, changes, refs, {\n\t\t\t\t\t\t\tconfigConfinedToRefs: options?.configConfinedToRefs,\n\t\t\t\t\t\t\tmovedWorktrees: this.getMovedWorktrees([repoPath], changes),\n\t\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t\tthis._localRepositories = options.localRepositories ?? true;\n\t\tthis._ignoredWorktreeFolders = sanitizeIgnoredWorktreeFolders(options.ignoredWorktreeFolders);\n\t\tthis._git =\n\t\t\toptions.git ??\n\t\t\tnew Git(options.locator, {\n\t\t\t\t...options.gitOptions,\n\t\t\t\t// The workspace flag, when the context has one, answers for every path; otherwise the host's own\n\t\t\t\t// per-path predicate (`gitOptions.isTrusted`) stands, so a multi-repository host can refuse one repository\n\t\t\t\tisTrusted:\n\t\t\t\t\toptions.context.workspace?.isTrusted != null\n\t\t\t\t\t\t? () => options.context.workspace!.isTrusted!\n\t\t\t\t\t\t: options.gitOptions?.isTrusted,\n\t\t\t});\n\t\tthis._cacheOwned = !(options.cache instanceof Cache);\n\t\tthis._cache = options.cache instanceof Cache ? options.cache : new Cache();\n\t\tthis._indexRefresher = new IndexRefresher({\n\t\t\t...options.indexRefresh,\n\t\t\tafterWrites: options.refreshIndexAfterWrites,\n\t\t\tgit: this._git,\n\t\t\tstatIndexMtimeMs: checkoutPath => this.statIndexMtimeMs(checkoutPath),\n\t\t});\n\n\t\t// Wires a raw `git.run({ notify })` call back to this provider's own cache/host announcement —\n\t\t// unconditionally, so a host-supplied `options.git` gets bound exactly like one we construct here.\n\t\tthis._git.bindChangeNotifier((repoPaths, changes, sharedPaths, named) =>\n\t\t\tthis.notifyChangedCore(repoPaths, changes, undefined, sharedPaths, named),\n\t\t);\n\t\tthis._git.bindHeadReader(path => readHeadState(path, this.context.fs, this._cache));\n\t\t// Bound even with no folder registered, so a `Git` shared with another provider never keeps that one's folders\n\t\tthis._git.bindIgnoredWorktreeRootsReader(path => this.getIgnoredWorktreeRoots(path));\n\t\tthis._unregisterListener = this._cache.onDidUnregisterRepoPath(repoPath =>\n\t\t\tthis._git.clearPendingCommands([repoPath]),\n\t\t);\n\t\tthis._resetListener = this._cache.onDidReset(() => this._git.clearPendingCommands());\n\t}\n\n\t/** The underlying cache instance (for repo path registration, etc.) */\n\tget cache(): Cache {\n\t\treturn this._cache;\n\t}\n\n\t/** The per-checkout queue that refreshes an index a write left with untrusted entries */\n\tget indexRefresher(): IndexRefresher {\n\t\treturn this._indexRefresher;\n\t}\n\n\tprivate async statIndexMtimeMs(checkoutPath: string): Promise<number | undefined> {\n\t\ttry {\n\t\t\tlet gitDir = this._cache.gitDir.get(checkoutPath);\n\t\t\tif (gitDir == null) {\n\t\t\t\t// A failed clone or worktree add leaves no checkout, and resolving one there anyway would cache, for its\n\t\t\t\t// path, the git dir of whatever repository git falls back to\n\t\t\t\tif (!(await fsExists(path.join(checkoutPath, '.git')))) return undefined;\n\n\t\t\t\tgitDir = await this.config.getGitDir(checkoutPath);\n\t\t\t}\n\t\t\treturn (await fs.stat(path.join(gitDir.uri.fsPath, 'index'))).mtimeMs;\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tget onDidChangeMergeTargets(): Event<MergeTargetsChangeEvent> {\n\t\treturn this._cache.onDidChangeMergeTargets;\n\t}\n\n\tgetIgnoredWorktreeFolders(_repoPath: string): readonly string[] {\n\t\treturn this._ignoredWorktreeFolders;\n\t}\n\n\t/**\n\t * `[]`, reading nothing, when no folder is registered. Read once per common git dir, since a worktree list rebuild\n\t * and every inferred worktree write ask for them; a read that fails or doesn't settle in time (a hung mount) rejects,\n\t * and isn't kept, so the next call reads again\n\t */\n\tasync getIgnoredWorktreeRoots(repoPath: string): Promise<readonly string[]> {\n\t\tif (!this._ignoredWorktreeFolders.length) return [];\n\n\t\tconst commonGitDir = await cancellable(this.findCommonGitDir(repoPath), ignoredWorktreeRootsTimeoutMs);\n\t\tlet roots = this._ignoredWorktreeRoots.get(commonGitDir);\n\t\tif (roots == null) {\n\t\t\tconst read = cancellable(this.readIgnoredWorktreeRoots(commonGitDir), ignoredWorktreeRootsTimeoutMs);\n\t\t\tconst entry = read.then(r => r.roots);\n\t\t\troots = entry;\n\t\t\tthis._ignoredWorktreeRoots.set(commonGitDir, entry);\n\t\t\tconst forget = () => {\n\t\t\t\tif (this._ignoredWorktreeRoots.get(commonGitDir) === entry) {\n\t\t\t\t\tthis._ignoredWorktreeRoots.delete(commonGitDir);\n\t\t\t\t}\n\t\t\t};\n\t\t\t// Roots missing the resolved spelling still serve this call, but a later one resolves again\n\t\t\tvoid read.then(r => (r.resolved ? undefined : forget()), forget);\n\t\t}\n\t\treturn roots;\n\t}\n\n\t/**\n\t * From the cached git dir, or the repository's own files, without running git; a repository whose files don't\n\t * show it (a bare one) runs git once, and the git dir it finds is cached with the repository\n\t */\n\tprivate async findCommonGitDir(repoPath: string): Promise<string> {\n\t\tconst commonGitDir = await readCommonGitDir(repoPath, this.context.fs, this._cache);\n\t\tif (commonGitDir != null) return commonGitDir;\n\n\t\tconst gitDir = await this.config.getGitDir(repoPath);\n\t\treturn (gitDir.commonUri ?? gitDir.uri).fsPath;\n\t}\n\n\t/** `resolved` is false when the common git dir's resolved spelling couldn't be read */\n\tprivate async readIgnoredWorktreeRoots(\n\t\tcommonGitDir: string,\n\t): Promise<{ readonly roots: readonly string[]; readonly resolved: boolean }> {\n\t\tconst roots = new Set(this._ignoredWorktreeFolders.map(f => normalizePath(joinPaths(commonGitDir, f))));\n\t\tif (!this._localRepositories) return { roots: [...roots], resolved: true };\n\n\t\t// Only the common git dir is resolved: a folder doesn't exist until its tool first makes a worktree there\n\t\tconst realCommonGitDir = await fs.realpath(commonGitDir).catch(() => undefined);\n\t\tif (realCommonGitDir == null) return { roots: [...roots], resolved: false };\n\n\t\tfor (const folder of this._ignoredWorktreeFolders) {\n\t\t\troots.add(normalizePath(joinPaths(realCommonGitDir, folder)));\n\t\t}\n\t\treturn { roots: [...roots], resolved: true };\n\t}\n\n\tensureRegistered(repoPath: string): Promise<void> | undefined {\n\t\treturn this._cache.ensureRegistered(repoPath);\n\t}\n\n\tgetCommonPath(repoPath: string): string | undefined {\n\t\t// An unregistered path is its own common path in the cache, which would hide a sibling worktree's writes\n\t\treturn this._cache.isRegistered(repoPath) ? this._cache.getCommonPath(repoPath) : undefined;\n\t}\n\n\tprivate readonly _onDidAnnounceChanges = new Emitter<AnnouncedRepositoryChanges>();\n\tget onDidAnnounceChanges(): Event<AnnouncedRepositoryChanges> {\n\t\treturn this._onDidAnnounceChanges.event;\n\t}\n\n\t/** The underlying git execution instance (for sub-providers that need direct exec/stream access) */\n\tget git(): Git {\n\t\treturn this._git;\n\t}\n\n\t/** Returns whether the installed git version supports the given feature. */\n\tsupports(feature: GitFeatures): boolean | Promise<boolean> {\n\t\treturn this._git.supports(feature);\n\t}\n\n\t/** Returns all features matching the prefix that the installed git version supports. */\n\tsupported<T extends GitFeatureOrPrefix>(feature: T): FilteredGitFeatures<T>[] | Promise<FilteredGitFeatures<T>[]> {\n\t\treturn this._git.supported(feature);\n\t}\n\n\t/** Throws if the installed git version does not support the given feature. */\n\tasync ensureSupports(feature: GitFeatures, prefix: string, suffix: string): Promise<void>;\n\tasync ensureSupports(feature: GitFeatures, message: GitFeatureUnsupportedMessage): Promise<void>;\n\tasync ensureSupports(\n\t\tfeature: GitFeatures,\n\t\tprefixOrMessage: string | GitFeatureUnsupportedMessage,\n\t\tsuffix?: string,\n\t): Promise<void> {\n\t\treturn typeof prefixOrMessage === 'function'\n\t\t\t? this._git.ensureSupports(feature, prefixOrMessage)\n\t\t\t: this._git.ensureSupports(feature, prefixOrMessage, suffix!);\n\t}\n\n\t/** Returns the installed git version string. */\n\tasync version(): Promise<string> {\n\t\treturn this._git.version();\n\t}\n\n\t/** Returns the resolved git binary path. */\n\tasync path(): Promise<string> {\n\t\treturn this._git.path();\n\t}\n\n\tasync clone(\n\t\turl: string,\n\t\tparentPath: string,\n\t\toptions?: { folderName?: string },\n\t\trunOptions?: GitOperationRunOptions,\n\t): Promise<string | undefined> {\n\t\tlet folderPath: string;\n\t\tif (options?.folderName) {\n\t\t\tfolderPath = joinPaths(parentPath, options.folderName);\n\t\t} else {\n\t\t\tconst [, , remotePath] = parseGitRemoteUrl(url);\n\t\t\tconst remoteName = remotePath.split('/').pop();\n\t\t\tif (!remoteName) return undefined;\n\n\t\t\tlet count = 0;\n\t\t\tfolderPath = joinPaths(parentPath, remoteName);\n\t\t\twhile ((await fsExists(folderPath)) && count < 20) {\n\t\t\t\tcount++;\n\t\t\t\tfolderPath = joinPaths(parentPath, `${remoteName}-${count}`);\n\t\t\t}\n\t\t}\n\n\t\t// `throw`: the default handler swallows `remoteConnectionError`, which would return a folder never cloned\n\t\tawait this._indexRefresher.refreshAfter(folderPath, () =>\n\t\t\tthis._git.run({ cwd: parentPath, errors: 'throw', ...runOptions }, 'clone', url, folderPath),\n\t\t);\n\n\t\treturn folderPath;\n\t}\n\n\t/** Creates a new repository at `targetPath` (`git init`), creating it first if it doesn't yet exist. */\n\tasync init(targetPath: string, options?: { defaultBranch?: string; bare?: boolean }): Promise<void> {\n\t\tawait fs.mkdir(targetPath, { recursive: true });\n\n\t\tconst args = ['init'];\n\t\tif (options?.defaultBranch) {\n\t\t\targs.push('-b', options.defaultBranch);\n\t\t}\n\t\tif (options?.bare) {\n\t\t\targs.push('--bare');\n\t\t}\n\n\t\t// Run inside the target rather than naming it from its parent: a relative `targetPath` would otherwise\n\t\t// be resolved against the parent a second time\n\t\tawait this._git.run({ cwd: targetPath }, ...args);\n\t}\n\n\t/**\n\t * Notifies the provider that `repoPath` was mutated outside of a typed sub-provider method — e.g. a\n\t * consumer that ran a command through the raw `git.run`/`provider.git.run` escape hatch. Fires the same\n\t * `cache.onReset`/`repository.onChanged` hooks a typed mutator would, so, exactly as after a typed write,\n\t * the provider hard-evicts its own caches for `repoPath` and drops its pending commands for the repository\n\t * (its sibling worktrees included) before the host's handlers run.\n\t *\n\t * What is reset: `options.cache` when given (`'all'` for everything, `[]` for nothing); otherwise the\n\t * cache types `changes` map to, the same mapping a file watcher's changes get, status clock included.\n\t * An empty `changes`, or one naming `'unknown'` or `'closed'`, resets everything. Changes that map to\n\t * no cache type (e.g. `'starred'`) reset nothing, and `onReset` doesn't fire; `onChanged` always fires.\n\t */\n\tnotifyChanged(\n\t\trepoPath: string,\n\t\tchanges: readonly RepositoryChange[],\n\t\toptions?: { cache?: readonly CachedGitTypes[] | 'all' },\n\t): void {\n\t\tthis.notifyChangedCore([repoPath], changes, options);\n\t}\n\n\t/**\n\t * {@link notifyChanged} for one change seen from several paths, e.g. a `-C` shared-state verb announced\n\t * for both its target and the caller's `cwd`. Each path's caches are reset and the host's `onReset` fires\n\t * for each, since a host may keep per-worktree state, but a repository's pending commands are dropped once\n\t * however many of its worktrees are named.\n\t *\n\t * Each path hears the announcement once: `repoPaths` hear all of `changes`, `sharedPaths` (reset and\n\t * `onReset`-ed like `repoPaths`) and then the other registered worktrees sharing a repository with any of\n\t * them (reset like a typed write's, with no `onReset`) hear the shared part of it, see\n\t * {@link getSiblingChanges}. `names.refs` reach `repoPaths` whole and the others as {@link getSharedRefs}.\n\t */\n\tprivate notifyChangedCore(\n\t\trepoPaths: readonly string[],\n\t\tchanges: readonly RepositoryChange[],\n\t\toptions?: { cache?: readonly CachedGitTypes[] | 'all' },\n\t\tsharedPaths?: readonly string[],\n\t\tnames?: NamedRefs,\n\t): void {\n\t\tconst announcements = new Map<string, readonly RepositoryChange[]>();\n\t\tfor (const repoPath of repoPaths) {\n\t\t\tannouncements.set(repoPath, [...changes]);\n\t\t}\n\t\tconst shared = sharedPaths?.length ? this.getSharedChanges(changes) : undefined;\n\t\tif (shared != null) {\n\t\t\tfor (const path of sharedPaths!) {\n\t\t\t\tif (!announcements.has(path)) {\n\t\t\t\t\tannouncements.set(path, shared);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst resets: { repoPath: string; types: CachedGitTypes[] }[] = [];\n\t\tconst pendingPaths = new Set<string>();\n\t\tfor (const [repoPath, announced] of announcements) {\n\t\t\tconst types = this.resetForChanges(\n\t\t\t\trepoPath,\n\t\t\t\tannounced,\n\t\t\t\toptions?.cache,\n\t\t\t\trepoPaths.includes(repoPath) ? 'all' : 'shared',\n\t\t\t);\n\t\t\tif (types == null) {\n\t\t\t\t// A gk config change is reconciled outside the cache types, but its re-read must not join a pre-write run\n\t\t\t\tif (options?.cache == null && announced.includes('gkConfig')) {\n\t\t\t\t\tfor (const path of this.getRepositoryPaths(repoPath)) {\n\t\t\t\t\t\tpendingPaths.add(path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tresets.push({ repoPath: repoPath, types: types });\n\t\t\tif (resetDropsPendingRuns(types)) {\n\t\t\t\tfor (const path of this.getRepositoryPaths(repoPath)) {\n\t\t\t\t\tpendingPaths.add(path);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// The worktrees no one named: their shared refs, tags, stash, remotes and config just changed too\n\t\tconst named = [...announcements.keys()];\n\t\tfor (const repoPath of named) {\n\t\t\tfor (const [path, siblingChanges] of this.getSiblingChanges(repoPath, changes)) {\n\t\t\t\tif (announcements.has(path)) continue;\n\n\t\t\t\tannouncements.set(path, siblingChanges);\n\t\t\t\tthis.resetForChanges(path, siblingChanges, options?.cache, 'sibling');\n\t\t\t}\n\t\t}\n\n\t\tif (pendingPaths.size) {\n\t\t\tthis._git.clearPendingCommands([...pendingPaths]);\n\t\t}\n\t\tfor (const { repoPath, types } of resets) {\n\t\t\tthis._hostHooks?.cache?.onReset?.(repoPath, ...types);\n\t\t}\n\t\t// The host's own hook: `context.hooks.repository.onChanged` also fans out to siblings, which would\n\t\t// announce a path a second time\n\t\tconst sharedRefs = names?.refs.length ? getSharedRefs(changes, names.refs) : undefined;\n\t\tconst movedWorktrees = this.getMovedWorktrees(repoPaths, changes);\n\t\tfor (const [path, announced] of announcements) {\n\t\t\tthis.announceChanged(path, [...announced], repoPaths.includes(path) ? names?.refs : sharedRefs, {\n\t\t\t\tconfigConfinedToRefs: names?.configConfinedToRefs,\n\t\t\t\tmovedWorktrees: movedWorktrees,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Announces a typed write that ran in `repoPath`, as `context.hooks.repository.onChanged` does, for a write that\n\t * knows which linked worktrees' HEADs it moved (see `AnnouncedRepositoryChanges.movedWorktrees`) where `repoPath`\n\t * doesn't say: a worktree added or removed from it. `options.configConfinedToRefs` is as for the hook.\n\t *\n\t * @internal not intended to be used outside of the sub-providers\n\t */\n\tannounceWrite(\n\t\trepoPath: string,\n\t\tchanges: RepositoryChange[],\n\t\trefs?: readonly string[],\n\t\toptions?: { readonly configConfinedToRefs?: boolean; readonly movedWorktrees?: readonly string[] },\n\t): void {\n\t\t// Everything the watcher would have cleared for the write, since its own file events are dropped once it is\n\t\t// announced (the typed write's `onReset` names only what it must evict)\n\t\tthis.resetForChanges(repoPath, changes, undefined);\n\t\t// Worktrees share refs, tags, stash, remotes and config, so a typed write in one changes what its siblings show;\n\t\t// the host hears the shared part of it for each, and they read fresh. Every path is reset before any is\n\t\t// announced, so a read the host starts on hearing one path isn't evicted by the next path's reset\n\t\tconst siblings = this.getSiblingChanges(repoPath, changes);\n\t\tfor (const [path, shared] of siblings) {\n\t\t\tthis.resetForChanges(path, shared, undefined, 'sibling');\n\t\t}\n\n\t\tthis.announceChanged(repoPath, changes, refs, options);\n\t\tif (siblings.size === 0) return;\n\n\t\t// Siblings share the one `.git/config`, so the write's config is as confined for them, and they hear the same\n\t\t// worktrees moved\n\t\tconst sharedRefs = refs?.length ? getSharedRefs(changes, refs) : undefined;\n\t\tfor (const [path, shared] of siblings) {\n\t\t\tthis.announceChanged(path, shared, sharedRefs, options);\n\t\t}\n\t}\n\n\t/**\n\t * The linked worktrees whose HEAD a write that ran in `paths` moved, for a `worktreeHead` among `changes` (see\n\t * `AnnouncedRepositoryChanges.movedWorktrees`): those of `paths` when it rewrote their HEAD, which it announces as\n\t * `head`, and otherwise none, as the worktree it added or removed is unknown here; `undefined` without\n\t * `worktreeHead`\n\t */\n\tprivate getMovedWorktrees(paths: readonly string[], changes: readonly RepositoryChange[]): string[] | undefined {\n\t\tif (!changes.includes('worktreeHead')) return undefined;\n\t\tif (!changes.includes('head')) return [];\n\n\t\tconst ids: string[] = [];\n\t\tfor (const path of paths) {\n\t\t\tconst id = this._cache.getLinkedWorktreeId(normalizePath(path));\n\t\t\tif (id != null) {\n\t\t\t\tids.push(id);\n\t\t\t}\n\t\t}\n\t\treturn ids;\n\t}\n\n\t/**\n\t * Tells only the host's own `repository.onChanged` about `changes` — for a follow-up that is not a write of\n\t * core's, such as re-announcing an outside change once it was reconciled. Nothing is evicted, no sibling hears\n\t * it, and the watch layer doesn't take it for a write's announcement.\n\t */\n\tnotifyHost(repoPath: string, changes: RepositoryChange[]): void {\n\t\tthis._hostHooks?.repository?.onChanged?.(repoPath, changes);\n\t}\n\n\t/**\n\t * Tells the host about a write for one path, after its caches were reset — the watch layer hears of it first.\n\t * `refs` are the full ref names the write moved, when it knows them, and `options.configConfinedToRefs` confines\n\t * its `config` change to the sections of the local branches among them (see `GitServiceHooks.repository.onChanged`);\n\t * the confinement is passed on only with `config` among `changes` and a branch in `refs` to confine it to.\n\t * `options.movedWorktrees` reaches the watch layer alone, and only with `worktreeHead` among `changes`.\n\t */\n\tprivate announceChanged(\n\t\trepoPath: string,\n\t\tchanges: RepositoryChange[],\n\t\trefs?: readonly string[],\n\t\toptions?: { readonly configConfinedToRefs?: boolean; readonly movedWorktrees?: readonly string[] },\n\t): void {\n\t\tconst moved =\n\t\t\toptions?.movedWorktrees != null && changes.includes('worktreeHead')\n\t\t\t\t? { movedWorktrees: options.movedWorktrees }\n\t\t\t\t: undefined;\n\t\tif (refs?.length) {\n\t\t\tif (\n\t\t\t\toptions?.configConfinedToRefs === true &&\n\t\t\t\tchanges.includes('config') &&\n\t\t\t\trefs.some(r => r.startsWith('refs/heads/'))\n\t\t\t) {\n\t\t\t\tthis._onDidAnnounceChanges.fire({\n\t\t\t\t\trepoPath: repoPath,\n\t\t\t\t\tchanges: changes,\n\t\t\t\t\trefs: refs,\n\t\t\t\t\tconfigConfinedToRefs: true,\n\t\t\t\t\t...moved,\n\t\t\t\t});\n\t\t\t\tthis._hostHooks?.repository?.onChanged?.(repoPath, changes, refs, { configConfinedToRefs: true });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._onDidAnnounceChanges.fire({ repoPath: repoPath, changes: changes, refs: refs, ...moved });\n\t\t\tthis._hostHooks?.repository?.onChanged?.(repoPath, changes, refs);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._onDidAnnounceChanges.fire({ repoPath: repoPath, changes: changes, ...moved });\n\t\tthis._hostHooks?.repository?.onChanged?.(repoPath, changes);\n\t}\n\n\t/**\n\t * What the worktrees sharing a repository hear of `changes` that ran in one of them: the part worktrees\n\t * share (see {@link worktreeSharedChanges}), or `undefined` when `changes` has none. An empty `changes` or\n\t * `'unknown'` means everything may have changed, so it reaches them as every shared kind — never as\n\t * `'unknown'` itself, which a host treats as the end of a watch session; `'closed'` concerns the one path\n\t * alone and reaches none.\n\t */\n\tprivate getSharedChanges(changes: readonly RepositoryChange[]): RepositoryChange[] | undefined {\n\t\tif (changes.includes('closed')) return undefined;\n\t\tif (!changes.length || changes.includes('unknown')) return [...worktreeSharedChanges];\n\n\t\tconst shared = changes.filter(c => worktreeSharedChanges.has(c));\n\t\treturn shared.length ? shared : undefined;\n\t}\n\n\t/** What each registered worktree sharing `repoPath`'s repository, other than `repoPath`, hears of `changes`. */\n\tprivate getSiblingChanges(repoPath: string, changes: readonly RepositoryChange[]): Map<string, RepositoryChange[]> {\n\t\tconst siblings = new Map<string, RepositoryChange[]>();\n\t\tconst shared = this.getSharedChanges(changes);\n\t\tif (shared == null) return siblings;\n\n\t\tconst self = normalizePath(repoPath);\n\t\tfor (const path of this._cache.getWorktreePaths(this._cache.getCommonPath(repoPath))) {\n\t\t\tif (path !== self) {\n\t\t\t\tsiblings.set(path, [...shared]);\n\t\t\t}\n\t\t}\n\t\treturn siblings;\n\t}\n\n\t/**\n\t * Evicts what a notified change reset for `repoPath`: the types reset (`[]` = all), or `undefined` for none.\n\t * `heard` is how `repoPath` heard the write:\n\t * - `'all'`: all of it, as the path it ran in or one it was announced whole for, so the changes are announced for it\n\t * (see `Cache.applyRepositoryChanges`)\n\t * - `'shared'`: the shared part, as the caller's `cwd` of a `-C` write elsewhere, so a `'worktreeHead'` among them is\n\t * another worktree's, which `-C` may have named by a folder inside it, and every other linked worktree loses its\n\t * current branch\n\t * - `'sibling'`: the shared part, as a path sharing its repository with one already reset for the same change, which\n\t * evicted the shared entries for every worktree, so the changes evict only its own entries and advance its\n\t * status clock\n\t */\n\tprivate resetForChanges(\n\t\trepoPath: string,\n\t\tchanges: readonly RepositoryChange[],\n\t\tcache: readonly CachedGitTypes[] | 'all' | undefined,\n\t\theard: 'all' | 'shared' | 'sibling' = 'all',\n\t): CachedGitTypes[] | undefined {\n\t\tif (cache != null && cache !== 'all') {\n\t\t\tif (!cache.length) return undefined;\n\n\t\t\tthis._cache.evictCaches(repoPath, ...cache);\n\t\t\treturn [...cache];\n\t\t}\n\n\t\tif (cache === 'all' || !changes.length || changes.some(c => c === 'unknown' || c === 'closed')) {\n\t\t\tthis._cache.evictCaches(repoPath);\n\t\t\treturn [];\n\t\t}\n\n\t\tconst types = this._cache.applyRepositoryChanges(\n\t\t\trepoPath,\n\t\t\tchanges,\n\t\t\t'evict',\n\t\t\theard === 'sibling' ? { worktreeOnly: true } : { announced: heard === 'all' },\n\t\t);\n\t\treturn types.length ? types : undefined;\n\t}\n\n\t/** `repoPath` and every worktree registered as sharing its repository, since a shared-ref write moves them all. */\n\tprivate getRepositoryPaths(repoPath: string): string[] {\n\t\tconst commonPath = this._cache.getCommonPath(repoPath);\n\t\treturn [...new Set([repoPath, commonPath, ...this._cache.getWorktreePaths(commonPath)])];\n\t}\n\n\tprivate _blame: BlameGitSubProvider | undefined;\n\tget blame(): BlameGitSubProvider {\n\t\treturn (this._blame ??= new BlameGitSubProvider(\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _branches: BranchesGitSubProvider | undefined;\n\tget branches(): BranchesGitSubProvider {\n\t\treturn (this._branches ??= new BranchesGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _commits: CommitsGitSubProvider | undefined;\n\tget commits(): CommitsGitSubProvider {\n\t\treturn (this._commits ??= new CommitsGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _config: ConfigGitSubProvider | undefined;\n\tget config(): ConfigGitSubProvider {\n\t\treturn (this._config ??= new ConfigGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _contributors: ContributorsGitSubProvider | undefined;\n\tget contributors(): ContributorsGitSubProvider {\n\t\treturn (this._contributors ??= new ContributorsGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _diff: DiffGitSubProvider | undefined;\n\tget diff(): DiffGitSubProvider {\n\t\treturn (this._diff ??= new DiffGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _graph: GraphGitSubProvider | undefined;\n\tget graph(): GraphGitSubProvider {\n\t\treturn (this._graph ??= new GraphGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _maintenance: MaintenanceGitSubProvider | undefined;\n\t// Optional so subclasses whose repos aren't local can report the capability as absent — see\n\t// `VslsGitProvider`. Consumers already treat `maintenance == null` as \"unsupported here\" (web builds\n\t// never register it at all).\n\tget maintenance(): MaintenanceGitSubProvider | undefined {\n\t\tif (!this._localRepositories) return undefined;\n\n\t\treturn (this._maintenance ??= new MaintenanceGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _ops: OperationsGitSubProvider | undefined;\n\tget ops(): OperationsGitSubProvider {\n\t\treturn (this._ops ??= new OperationsGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t\tthis._indexRefresher,\n\t\t));\n\t}\n\n\tprivate _patch: PatchGitSubProvider | undefined;\n\tget patch(): PatchGitSubProvider {\n\t\treturn (this._patch ??= new PatchGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _pausedOps: PausedOperationsGitSubProvider | undefined;\n\tget pausedOps(): PausedOperationsGitSubProvider {\n\t\treturn (this._pausedOps ??= new PausedOperationsGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t\tthis._indexRefresher,\n\t\t));\n\t}\n\n\tprivate _refs: RefsGitSubProvider | undefined;\n\tget refs(): RefsGitSubProvider {\n\t\treturn (this._refs ??= new RefsGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _remotes: RemotesGitSubProvider | undefined;\n\tget remotes(): RemotesGitSubProvider {\n\t\treturn (this._remotes ??= new RemotesGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _revision: RevisionGitSubProvider | undefined;\n\tget revision(): RevisionGitSubProvider {\n\t\treturn (this._revision ??= new RevisionGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _staging: StagingGitSubProvider | undefined;\n\tget staging(): StagingGitSubProvider {\n\t\treturn (this._staging ??= new StagingGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _stash: StashGitSubProvider | undefined;\n\tget stash(): StashGitSubProvider {\n\t\treturn (this._stash ??= new StashGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t\tthis._indexRefresher,\n\t\t));\n\t}\n\n\tprivate _status: StatusGitSubProvider | undefined;\n\tget status(): StatusGitSubProvider {\n\t\treturn (this._status ??= new StatusGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _tags: TagsGitSubProvider | undefined;\n\tget tags(): TagsGitSubProvider {\n\t\treturn (this._tags ??= new TagsGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t));\n\t}\n\n\tprivate _worktrees: WorktreesGitSubProvider | undefined;\n\tget worktrees(): WorktreesGitSubProvider {\n\t\treturn (this._worktrees ??= new WorktreesGitSubProvider(\n\t\t\tthis.context,\n\t\t\tthis._git,\n\t\t\tthis._cache,\n\t\t\tthis as unknown as CliGitProviderInternal,\n\t\t\tthis._ignoredWorktreeFolders.length ? path => this.getIgnoredWorktreeRoots(path) : undefined,\n\t\t\tthis._indexRefresher,\n\t\t));\n\t}\n\n\tgetAbsoluteUri(pathOrUri: string | Uri, base: string | Uri): Uri {\n\t\tconst baseUri = typeof base !== 'string' ? base : fileUri(base);\n\t\tif (typeof pathOrUri !== 'string') return pathOrUri;\n\t\tif (maybeUri(pathOrUri)) return parseUri(pathOrUri);\n\t\tif (path.isAbsolute(pathOrUri)) return fileUri(pathOrUri);\n\t\treturn joinUriPath(baseUri, pathOrUri);\n\t}\n\n\tgetRelativePath(pathOrUri: string | Uri, base: string | Uri): string {\n\t\tconst [relativePath] = splitPath(toFsPath(pathOrUri), toFsPath(base));\n\t\treturn relativePath;\n\t}\n\n\tasync excludeIgnoredUris(repoPath: string, uris: Uri[]): Promise<Uri[]> {\n\t\tconst filter = this.getIgnoreFilter(repoPath);\n\t\t// Only a watcher refreshes the filter, and nothing may be watching this repository\n\t\tvoid filter.revalidate();\n\t\tawait filter.ready();\n\t\treturn uris.filter(uri => {\n\t\t\tconst relativePath = normalizePath(path.relative(repoPath, toFsPath(uri)));\n\t\t\treturn !relativePath || !filter.isIgnored(relativePath);\n\t\t});\n\t}\n\n\tasync getIgnoredUrisFilter(repoPath: string): Promise<(uri: Uri) => boolean> {\n\t\tconst filter = this.getIgnoreFilter(repoPath);\n\t\tvoid filter.revalidate();\n\t\tawait filter.ready();\n\t\treturn (uri: Uri) => {\n\t\t\tconst relativePath = normalizePath(path.relative(repoPath, toFsPath(uri)));\n\t\t\treturn relativePath ? filter.isIgnored(relativePath) : false;\n\t\t};\n\t}\n\n\tasync getLastFetchedTimestamp(repoPath: string): Promise<number | undefined> {\n\t\treturn this._cache.getLastFetchedTimestamp(repoPath, async (commonPath): Promise<number | undefined> => {\n\t\t\tconst gitDir = await this.config.getGitDir?.(commonPath).catch(() => undefined);\n\t\t\tif (gitDir == null) return undefined;\n\n\t\t\tconst gitDirUri = gitDir.commonUri ?? gitDir.uri;\n\t\t\tconst fetchHeadUri = joinUriPath(gitDirUri, 'FETCH_HEAD');\n\t\t\tconst stats = await this.context.fs.stat(fetchHeadUri);\n\t\t\t// If the file is empty, assume the fetch failed, and don't update the timestamp\n\t\t\tif (stats != null && stats.size > 0) return stats.mtime;\n\n\t\t\treturn undefined;\n\t\t});\n\t}\n\n\tgetIgnoreFilter(repoPath: string): GitIgnoreFilter {\n\t\tlet filter = this._cache.gitIgnore.get(repoPath);\n\t\tif (filter == null) {\n\t\t\tconst gitDir = this._cache.gitDir.get(repoPath);\n\t\t\tconst gitDirPath = gitDir?.uri.fsPath ?? `${repoPath}/.git`;\n\t\t\tfilter = new GitIgnoreFilter({\n\t\t\t\trepoPath: repoPath,\n\t\t\t\tgitDirPath: gitDirPath,\n\t\t\t\tfs: this.context.fs,\n\t\t\t\tgetConfig: async () => {\n\t\t\t\t\tawait this._cache.ensureRegistered(repoPath);\n\t\t\t\t\tconst env = this._git.getRunEnvironment();\n\t\t\t\t\tconst { excludesFile, ignoreCase } = await this.config.getIgnoreConfig(repoPath);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tglobalExcludesPath:\n\t\t\t\t\t\t\texcludesFile == null\n\t\t\t\t\t\t\t\t? getDefaultGlobalExcludesPath(env)\n\t\t\t\t\t\t\t\t: resolveGitPathConfig(excludesFile, repoPath, env),\n\t\t\t\t\t\tignoreCase: parseIgnoreCase(ignoreCase),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t// `info/exclude` lives in the COMMON git dir — a linked worktree's own git dir has none\n\t\t\t\tgetInfoExcludePath: async () => {\n\t\t\t\t\tconst gitDir = await this.config.getGitDir?.(repoPath);\n\t\t\t\t\tif (gitDir == null) return undefined;\n\n\t\t\t\t\treturn `${(gitDir.commonUri ?? gitDir.uri).fsPath}/info/exclude`;\n\t\t\t\t},\n\t\t\t\tinvalidateConfig: () => this._cache.deleteIgnoreConfig(repoPath),\n\t\t\t\tgetGitIgnorePaths: () => this.getGitIgnorePaths(repoPath),\n\t\t\t});\n\t\t\tthis._cache.gitIgnore.set(repoPath, filter);\n\t\t}\n\t\treturn filter;\n\t}\n\n\tprivate async getConfigWatchPaths(\n\t\trepoPath: string,\n\t\tenv: Readonly<Record<string, string | undefined>>,\n\t): Promise<readonly string[] | undefined> {\n\t\tconst cached = this._configWatchPaths.get(env);\n\t\tif (cached != null) return cached;\n\n\t\t// KEEP: git var separates global candidates with LF and has no NUL-delimited output.\n\t\tif (\n\t\t\t[env.HOME, env.XDG_CONFIG_HOME, env.USERPROFILE, env.HOMEPATH, env.HOMEDRIVE].some(\n\t\t\t\tvalue => value != null && (/[\\r\\n]/.test(value) || value.split(path.sep).includes('..')),\n\t\t\t)\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst read = async (\n\t\t\tname: 'GIT_CONFIG_SYSTEM' | 'GIT_CONFIG_GLOBAL',\n\t\t\tlimit: number,\n\t\t): Promise<string[] | undefined> => {\n\t\t\tconst result = await this._git.run(\n\t\t\t\t{ cwd: repoPath, env: env, errors: 'ignore', expectedExitCodes: [1] },\n\t\t\t\t'var',\n\t\t\t\tname,\n\t\t\t);\n\t\t\tif (result.completion.status !== 'exited' || result.stderr) return undefined;\n\n\t\t\tif (result.exitCode === 1 && !result.stdout) {\n\t\t\t\tconst disabled =\n\t\t\t\t\tname === 'GIT_CONFIG_SYSTEM'\n\t\t\t\t\t\t? parseGitBoolean(env.GIT_CONFIG_NOSYSTEM)\n\t\t\t\t\t\t: env.HOME == null && !env.XDG_CONFIG_HOME;\n\t\t\t\treturn disabled ? [] : undefined;\n\t\t\t}\n\n\t\t\tconst output = isWindows ? result.stdout.replaceAll('\\r\\n', '\\n') : result.stdout;\n\t\t\tif (result.exitCode !== 0 || !output.endsWith('\\n') || /[\\r\\0\\ufffd]/.test(output)) return undefined;\n\n\t\t\tconst paths = output.slice(0, -1).split('\\n');\n\t\t\treturn paths.length <= limit && paths.every(candidate => path.isAbsolute(candidate)) ? paths : undefined;\n\t\t};\n\t\tconst pending = Promise.all([read('GIT_CONFIG_SYSTEM', 1), read('GIT_CONFIG_GLOBAL', 2)]).then(\n\t\t\t([system, global]) => (system != null && global != null ? [...new Set([...system, ...global])] : undefined),\n\t\t);\n\t\tthis._configWatchPaths.set(env, pending);\n\t\tlet paths: readonly string[] | undefined;\n\t\ttry {\n\t\t\tpaths = await pending;\n\t\t\treturn paths;\n\t\t} finally {\n\t\t\tif (paths == null) {\n\t\t\t\tthis._configWatchPaths.delete(env);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync getGitIgnoreWatchInputs(\n\t\trepoPath: string,\n\t\tgitDir: GitDir,\n\t\toptions?: { refreshConfig?: boolean },\n\t): Promise<GitIgnoreWatchInputs | undefined> {\n\t\tif (!this._localRepositories) return undefined;\n\n\t\tawait this._cache.ensureRegistered(repoPath);\n\t\tif (options?.refreshConfig) {\n\t\t\tthis._cache.deleteIgnoreConfig(repoPath);\n\t\t}\n\t\tconst gitEnv = this._git.getRunEnvironment();\n\t\tif (\n\t\t\tisGitDirMovedByEnv(gitEnv) ||\n\t\t\tgitEnv.GIT_INDEX_FILE != null ||\n\t\t\tgitEnv.GIT_CONFIG != null ||\n\t\t\tgitEnv.GIT_CONFIG_GLOBAL != null ||\n\t\t\tgitEnv.GIT_CONFIG_SYSTEM != null ||\n\t\t\tignoreConfigOverrideRegex.test(gitEnv.GIT_CONFIG_PARAMETERS ?? '') ||\n\t\t\tObject.entries(gitEnv).some(\n\t\t\t\t([key, value]) => key.startsWith('GIT_CONFIG_KEY_') && ignoreConfigOverrideRegex.test(value ?? ''),\n\t\t\t)\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst config = await this.config.getIgnoreConfig(repoPath, { observableOnly: true });\n\t\tif (config == null) return undefined;\n\n\t\tconst ignoreCase = parseIgnoreCase(config.ignoreCase);\n\t\tif (config.ignoreCase != null && ignoreCase == null) return undefined;\n\n\t\tif (\n\t\t\tconfig.excludesFile?.startsWith('%(prefix)/') ||\n\t\t\t(config.excludesFile?.startsWith('~') &&\n\t\t\t\tconfig.excludesFile !== '~' &&\n\t\t\t\t!config.excludesFile.startsWith('~/'))\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst commonGitDirPath = (gitDir.commonUri ?? gitDir.uri).fsPath;\n\t\tconst excludesFilePath =\n\t\t\tconfig.excludesFile == null\n\t\t\t\t? getDefaultGlobalExcludesPath(gitEnv)\n\t\t\t\t: resolveGitPathConfig(config.excludesFile, repoPath, gitEnv);\n\t\tif (\n\t\t\t!path.isAbsolute(commonGitDirPath) ||\n\t\t\t(config.excludesFile != null && excludesFilePath == null) ||\n\t\t\t(excludesFilePath != null && !path.isAbsolute(excludesFilePath))\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst systemAndGlobalConfigPaths = await this.getConfigWatchPaths(repoPath, gitEnv);\n\t\tif (systemAndGlobalConfigPaths == null) return undefined;\n\n\t\tconst sharedIndex = await this._git.run(\n\t\t\t{ cwd: repoPath, env: gitEnv, errors: 'throw' },\n\t\t\t'rev-parse',\n\t\t\t'--shared-index-path',\n\t\t);\n\t\tif (sharedIndex.completion.status !== 'exited' || sharedIndex.exitCode !== 0 || sharedIndex.stdout.trim()) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst tracked = await this._git.run(\n\t\t\t{ cwd: repoPath, env: gitEnv, errors: 'throw', maxBuffer: maxProtectedWatchListingBytes },\n\t\t\t'ls-files',\n\t\t\t'-z',\n\t\t\t'--cached',\n\t\t\t'--ignored',\n\t\t\t'--exclude-standard',\n\t\t\t'--stage',\n\t\t);\n\t\tif (\n\t\t\ttracked.completion.status !== 'exited' ||\n\t\t\ttracked.exitCode !== 0 ||\n\t\t\ttracked.stderr ||\n\t\t\ttracked.stdout.includes('\\ufffd')\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst protectedPaths = new Set<string>();\n\t\tconst ancestors = new Set<string>();\n\t\tfor (const record of iterateByDelimiter(tracked.stdout, '\\0')) {\n\t\t\tif (!record) continue;\n\n\t\t\tconst separator = record.indexOf('\\t');\n\t\t\tif (separator === -1) return undefined;\n\n\t\t\tconst entry = record.substring(separator + 1);\n\t\t\tprotectedPaths.add(entry);\n\t\t\tif (record.startsWith('160000 ')) {\n\t\t\t\tancestors.add(`${entry}/`);\n\t\t\t}\n\t\t\tfor (let slash = entry.indexOf('/'); slash !== -1; slash = entry.indexOf('/', slash + 1)) {\n\t\t\t\tancestors.add(entry.substring(0, slash + 1));\n\t\t\t}\n\t\t\tif (protectedPaths.size + ancestors.size > maxProtectedWatchPaths) return undefined;\n\t\t}\n\n\t\tconst protectedDirectories = new Set<string>();\n\t\tif (ancestors.size !== 0) {\n\t\t\tconst refused = await this.checkIgnore(repoPath, [...ancestors], protectedDirectories, { noIndex: true });\n\t\t\tif (refused != null) return undefined;\n\t\t}\n\n\t\tif (gitEnv !== this._git.getRunEnvironment()) return undefined;\n\n\t\treturn {\n\t\t\tinfoExcludePath: path.join(commonGitDirPath, 'info', 'exclude'),\n\t\t\texcludesFilePath: excludesFilePath ?? null,\n\t\t\tignoreCase: ignoreCase ?? false,\n\t\t\tconfigWatchPaths: [...new Set([...systemAndGlobalConfigPaths, path.join(commonGitDirPath, 'config')])],\n\t\t\tprotectedPaths: [...protectedPaths].sort(),\n\t\t\tprotectedDirectories: Array.from(protectedDirectories, directory => directory.slice(0, -1)).sort(),\n\t\t};\n\t}\n\n\tasync getIgnoredDirectories(repoPath: string, cancellation?: AbortSignal): Promise<string[]> {\n\t\t// `--directory` collapses a directory to one entry when everything in it is ignored — which includes\n\t\t// directories no rule matches whose current contents merely happen to be ignored (a `logs/` holding only\n\t\t// `*.log` files under a `*.log` rule), so each candidate is confirmed against the rules below\n\t\tconst listed = await this._git.run(\n\t\t\t{ cwd: repoPath, errors: 'throw', cancellation: cancellation },\n\t\t\t'ls-files',\n\t\t\t'-z',\n\t\t\t'--others',\n\t\t\t'--ignored',\n\t\t\t'--exclude-standard',\n\t\t\t'--directory',\n\t\t);\n\n\t\tconst candidates: string[] = [];\n\t\tfor (const entry of iterateByDelimiter(listed.stdout, '\\0')) {\n\t\t\tif (entry.length > 1 && entry.endsWith('/')) {\n\t\t\t\tcandidates.push(entry);\n\t\t\t}\n\t\t}\n\t\tif (!candidates.length) return [];\n\n\t\tconst confirmed = await this.getIgnoredPaths(repoPath, candidates, undefined, cancellation);\n\n\t\tconst directories: string[] = [];\n\t\tfor (const entry of confirmed) {\n\t\t\t// Never `.git` itself, and no name a watcher would read as a pattern\n\t\t\tif (entry.length < 2 || !entry.endsWith('/') || /[*?[\\]{}()!+@\\\\]/.test(entry)) continue;\n\n\t\t\tconst directory = entry.substring(0, entry.length - 1);\n\t\t\tif (directory === '.git') continue;\n\n\t\t\tdirectories.push(directory);\n\t\t}\n\n\t\t// A path sorts after every prefix of it, so an entry's ancestors have already been kept (or not) by the time it\n\t\t// is checked — and the kept set comes out sorted\n\t\tdirectories.sort();\n\n\t\tconst kept = new Set<string>();\n\t\tfor (const directory of directories) {\n\t\t\tlet beneathKept = false;\n\t\t\tfor (let i = directory.indexOf('/'); i !== -1; i = directory.indexOf('/', i + 1)) {\n\t\t\t\tif (kept.has(directory.substring(0, i))) {\n\t\t\t\t\tbeneathKept = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!beneathKept) {\n\t\t\t\tkept.add(directory);\n\t\t\t}\n\t\t}\n\n\t\treturn [...kept];\n\t}\n\n\tasync getIgnoredEntries(\n\t\trepoPath: string,\n\t\toptions?: { paths?: readonly string[]; priority?: GitCommandPriority },\n\t\tcancellation?: AbortSignal,\n\t): Promise<string[]> {\n\t\tlet paths = options?.paths;\n\t\t// No pathspec means \"everything\" to git, which is not what an empty list asks for\n\t\tif (paths != null && !paths.length) return [];\n\n\t\t// A scope inside an ignored folder makes git list the folder itself, or fail outright, so a scope that is\n\t\t// itself ignored is answered here, as one entry, and left out of the listing\n\t\tconst scopedEntries = new Set<string>();\n\t\tif (paths != null) {\n\t\t\tconst scopes = [...new Set(paths.map(p => (p.length > 1 ? trimTrailingSlashes(p) : p)))];\n\t\t\tconst ignoredScopes = await this.getIgnoredScopes(\n\t\t\t\trepoPath,\n\t\t\t\tscopes.filter(p => p !== ''),\n\t\t\t\toptions?.priority,\n\t\t\t\tcancellation,\n\t\t\t);\n\n\t\t\tconst ignored = [...ignoredScopes];\n\t\t\t// `lstat`, as git lists a symlink as a file even when it points at a folder\n\t\t\tconst listed = await Promise.allSettled(\n\t\t\t\tignored.map(async scope => {\n\t\t\t\t\tconst fullPath = path.join(repoPath, scope);\n\t\t\t\t\tif (!(await fs.lstat(fullPath)).isDirectory()) return scope;\n\n\t\t\t\t\treturn (await hasNonDirectoryEntry(fullPath)) ? `${scope}/` : undefined;\n\t\t\t\t}),\n\t\t\t);\n\t\t\tfor (const result of listed) {\n\t\t\t\t// Not on disk, so nothing is ignored there\n\t\t\t\tif (result.status === 'fulfilled' && result.value != null) {\n\t\t\t\t\tscopedEntries.add(result.value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpaths = scopes.filter(p => !ignoredScopes.has(p));\n\t\t\tif (!paths.length) return [...scopedEntries].sort();\n\t\t}\n\n\t\t// `status --ignored` walks every ignored tree, and `ls-files --directory` drops the ignored entries inside a\n\t\t// new untracked folder, so status is asked only about those folders\n\t\tconst args = ['ls-files', '-z', '--others', '--exclude-standard', '--directory', '--no-empty-directory'];\n\t\tconst runOptions = {\n\t\t\tcwd: repoPath,\n\t\t\terrors: 'throw',\n\t\t\tcancellation: cancellation,\n\t\t\tpriority: options?.priority,\n\t\t} as const;\n\n\t\tconst readListing = async (extra: readonly string[]): Promise<Set<string>> => {\n\t\t\tconst listed = new Set<string>();\n\t\t\tconst prefix = [...args, ...extra];\n\t\t\tfor (const batch of paths != null ? batchLiteralPathspecs(paths, prefix) : [undefined]) {\n\t\t\t\tconst result = await this._git.run(runOptions, ...prefix, ...(batch != null ? ['--', ...batch] : []));\n\t\t\t\tfor (const entry of iterateByDelimiter(result.stdout, '\\0')) {\n\t\t\t\t\tif (entry !== '') {\n\t\t\t\t\t\tlisted.add(entry);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn listed;\n\t\t};\n\n\t\tconst [ignoredResult, untrackedResult] = await Promise.allSettled([\n\t\t\treadListing(['--ignored']),\n\t\t\treadListing([]),\n\t\t]);\n\t\tif (ignoredResult.status === 'rejected') throw ignoredResult.reason;\n\t\tif (untrackedResult.status === 'rejected') throw untrackedResult.reason;\n\n\t\tconst entries = new Set<string>(scopedEntries);\n\t\tfor (const entry of ignoredResult.value) {\n\t\t\tif (entry !== '.git/') {\n\t\t\t\tentries.add(entry);\n\t\t\t}\n\t\t}\n\n\t\tconst folders: string[] = [];\n\t\tfor (const entry of untrackedResult.value) {\n\t\t\tif (entry.endsWith('/')) {\n\t\t\t\tfolders.push(entry);\n\t\t\t}\n\t\t}\n\t\tif (!folders.length) return [...entries].sort();\n\n\t\t// `matching` reports a folder an ignore rule matches without walking it, but lists each file of a folder that is\n\t\t// ignored only because all of its files are, so `all` untracked files are needed to fold those back\n\t\tconst matching = await this._git.supports('git:status:ignored-matching');\n\t\tconst prefix = [\n\t\t\t'status',\n\t\t\t'--porcelain',\n\t\t\t'-z',\n\t\t\tmatching ? '--ignored=matching' : '--ignored',\n\t\t\tmatching ? '--untracked-files=all' : '--untracked-files=normal',\n\t\t\t'--ignore-submodules=all',\n\t\t];\n\n\t\tconst records: string[] = [];\n\t\tfor (const batch of batchLiteralPathspecs(folders, prefix)) {\n\t\t\tconst listed = await this._git.run(\n\t\t\t\t{\n\t\t\t\t\t...runOptions,\n\t\t\t\t\tconfigs: [...gitConfigsStatus, '-c', 'status.renames=false'],\n\t\t\t\t\tenv: { GIT_OPTIONAL_LOCKS: '0' },\n\t\t\t\t},\n\t\t\t\t...prefix,\n\t\t\t\t'--',\n\t\t\t\t...batch,\n\t\t\t);\n\n\t\t\t// Only untracked folders are in scope, so there are no tracked entries, and no rename pairs, to step over\n\t\t\tfor (const record of iterateByDelimiter(listed.stdout, '\\0')) {\n\t\t\t\tif (matching) {\n\t\t\t\t\trecords.push(record);\n\t\t\t\t} else if (record.startsWith('!! ')) {\n\t\t\t\t\tentries.add(record.substring(3));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (matching) {\n\t\t\tfor (const entry of foldMatchingIgnored(records)) {\n\t\t\t\tentries.add(entry);\n\t\t\t}\n\t\t}\n\t\treturn [...entries].sort();\n\t}\n\n\t/**\n\t * Which of `scopes` are ignored. A scope git refuses (beyond a symlink, inside a submodule) is not ignored, as the\n\t * listing answers it with nothing. Any other failure answers none; when git itself is failing, the listing that\n\t * follows fails too.\n\t */\n\tprivate async getIgnoredScopes(\n\t\trepoPath: string,\n\t\tscopes: readonly string[],\n\t\tpriority: GitCommandPriority | undefined,\n\t\tcancellation: AbortSignal | undefined,\n\t): Promise<Set<string>> {\n\t\ttry {\n\t\t\treturn await this.getIgnoredPaths(repoPath, scopes, { priority: priority }, cancellation);\n\t\t} catch (ex) {\n\t\t\tif (isCancellationError(ex)) throw ex;\n\n\t\t\treturn new Set();\n\t\t}\n\t}\n\n\tasync getIgnoredPaths(\n\t\trepoPath: string,\n\t\tpaths: readonly string[],\n\t\toptions?: { priority?: GitCommandPriority },\n\t\tcancellation?: AbortSignal,\n\t): Promise<Set<string>> {\n\t\tconst ignored = new Set<string>();\n\t\tconst ambiguous = new Set<string>();\n\t\tawait this.collectIgnoredPaths(repoPath, paths, ignored, options, cancellation, ambiguous);\n\t\tif (ambiguous.size) {\n\t\t\t// KEEP: check-ignore rejects :(literal), and a wildcard matching an unrelated index entry can mask an ignore rule.\n\t\t\tawait this.collectIgnoredPaths(\n\t\t\t\trepoPath,\n\t\t\t\t[...ambiguous],\n\t\t\t\tignored,\n\t\t\t\t{ ...options, noIndex: true },\n\t\t\t\tcancellation,\n\t\t\t);\n\t\t}\n\t\tif (!ignored.size) return ignored;\n\n\t\tconst names = new Map<string, string>();\n\t\tfor (const match of ignored) {\n\t\t\tnames.set(match, path.relative(repoPath, path.resolve(repoPath, match)).split(path.sep).join('/'));\n\t\t}\n\t\tconst untracked = new Set(names.values());\n\t\tconst untrackedIgnoringCase = new Set(Array.from(untracked, foldGitPathCase));\n\t\tconst prefix = ['ls-files', '-z', '--cached'];\n\t\tconst runOptions = {\n\t\t\tcwd: repoPath,\n\t\t\terrors: 'throw',\n\t\t\tcancellation: cancellation,\n\t\t\tpriority: options?.priority,\n\t\t} as const;\n\t\tfor (const batch of batchLiteralPathspecs([...ignored], prefix)) {\n\t\t\tconst result = await this._git.run(\n\t\t\t\t{ ...runOptions, env: { GIT_ICASE_PATHSPECS: '1' } },\n\t\t\t\t...prefix,\n\t\t\t\t'--',\n\t\t\t\t...batch,\n\t\t\t);\n\t\t\tfor (const indexed of iterateByDelimiter(result.stdout, '\\0')) {\n\t\t\t\tfor (let name = indexed; name; name = name.substring(0, name.lastIndexOf('/'))) {\n\t\t\t\t\tuntracked.delete(name);\n\t\t\t\t\tuntrackedIgnoringCase.delete(foldGitPathCase(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlet ignoreCase: boolean | undefined;\n\t\tfor (const [original, name] of names) {\n\t\t\tif (!untracked.has(name)) {\n\t\t\t\tignored.delete(original);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (untrackedIgnoringCase.has(foldGitPathCase(name))) continue;\n\n\t\t\tif (ignoreCase == null) {\n\t\t\t\tconst result = await this._git.run(\n\t\t\t\t\t{ ...runOptions, expectedExitCodes: [1] },\n\t\t\t\t\t'config',\n\t\t\t\t\t'--bool',\n\t\t\t\t\t'--get',\n\t\t\t\t\t'core.ignorecase',\n\t\t\t\t);\n\t\t\t\tignoreCase = result.stdout.trim() === 'true';\n\t\t\t}\n\t\t\tif (ignoreCase) {\n\t\t\t\tignored.delete(original);\n\t\t\t}\n\t\t}\n\t\treturn ignored;\n\t}\n\n\tprivate async collectIgnoredPaths(\n\t\trepoPath: string,\n\t\tpaths: readonly string[],\n\t\tignored: Set<string>,\n\t\toptions?: { priority?: GitCommandPriority; noIndex?: boolean },\n\t\tcancellation?: AbortSignal,\n\t\tambiguous?: Set<string>,\n\t): Promise<void> {\n\t\tlet pending = paths;\n\t\twhile (pending.length) {\n\t\t\tconst refused = await this.checkIgnore(repoPath, pending, ignored, options, cancellation, ambiguous);\n\t\t\tif (refused == null) break;\n\n\t\t\tconst folder = refused.folderWide ? getRefusedFolder(pending[refused.index]) : undefined;\n\t\t\tpending = pending.slice(refused.index + 1);\n\t\t\tif (folder != null) {\n\t\t\t\tpending = pending.filter(p => !p.startsWith(folder) || hasDotSegment(p));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * One `check-ignore` run over `paths`, adding the ignored ones to `ignored`. Returns the path git died on, which\n\t * every path before it was answered ahead of, or `undefined` when all were answered.\n\t */\n\tprivate async checkIgnore(\n\t\trepoPath: string,\n\t\tpaths: readonly string[],\n\t\tignored: Set<string>,\n\t\toptions?: { priority?: GitCommandPriority; noIndex?: boolean },\n\t\tcancellation?: AbortSignal,\n\t\tambiguous?: Set<string>,\n\t): Promise<{ index: number; folderWide: boolean } | undefined> {\n\t\tconst lines = paths.map(p => (p.startsWith(':') ? `./${p}` : p));\n\n\t\tlet stdout: string;\n\t\tlet refusal: GitError | undefined;\n\t\ttry {\n\t\t\t// `-v -n` writes a record for every path answered, so the records line up with `paths` and end where git died\n\t\t\tconst result = await this._git.run(\n\t\t\t\t{\n\t\t\t\t\tcwd: repoPath,\n\t\t\t\t\terrors: 'throw',\n\t\t\t\t\tcancellation: cancellation,\n\t\t\t\t\tpriority: options?.priority,\n\t\t\t\t\tstdin: `${lines.join('\\0')}\\0`,\n\t\t\t\t\texpectedExitCodes: [1],\n\t\t\t\t},\n\t\t\t\t'check-ignore',\n\t\t\t\t...(options?.noIndex ? ['--no-index'] : []),\n\t\t\t\t'-v',\n\t\t\t\t'-n',\n\t\t\t\t'-z',\n\t\t\t\t'--stdin',\n\t\t\t);\n\t\t\tstdout = result.stdout;\n\t\t} catch (ex) {\n\t\t\tif (!(ex instanceof GitError) || ex.stderr == null || !GitErrors.pathspecRefused.test(ex.stderr)) throw ex;\n\n\t\t\trefusal = ex;\n\t\t\tstdout = ex.stdout ?? '';\n\t\t}\n\n\t\t// Each record is source, line number, pattern and path; the pattern is empty when none matched, and `!`-prefixed\n\t\t// when it re-includes the path\n\t\tlet index = 0;\n\t\tlet field = 0;\n\t\tlet pattern = '';\n\t\tfor (const value of iterateByDelimiter(stdout, '\\0')) {\n\t\t\tif (field === 2) {\n\t\t\t\tpattern = value;\n\t\t\t} else if (field === 3) {\n\t\t\t\tconst name = paths[index++];\n\t\t\t\tif (name != null && pattern && !pattern.startsWith('!')) {\n\t\t\t\t\tignored.add(name);\n\t\t\t\t} else if (name != null && !pattern && ambiguous != null && /[*?[\\\\]/.test(name)) {\n\t\t\t\t\tambiguous.add(name);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfield = (field + 1) % 4;\n\t\t}\n\n\t\tif (refusal == null) return undefined;\n\t\t// Every path answered yet git still died, so the refusal can't be pinned to one of them\n\t\tif (index >= paths.length) throw refusal;\n\n\t\treturn { index: index, folderWide: /is (?:beyond a symbolic link|in submodule)/i.test(refusal.stderr ?? '') };\n\t}\n\n\t/** Every `.gitignore` git reads in the working tree (tracked, or untracked and not itself ignored), root included */\n\tprivate async getGitIgnorePaths(repoPath: string): Promise<string[]> {\n\t\tconst result = await this._git.run(\n\t\t\t{ cwd: repoPath, errors: 'throw' },\n\t\t\t'ls-files',\n\t\t\t'-z',\n\t\t\t'--cached',\n\t\t\t'--others',\n\t\t\t'--exclude-standard',\n\t\t\t'--',\n\t\t\t':(glob)**/.gitignore',\n\t\t);\n\n\t\tconst paths: string[] = [];\n\t\tfor (const line of iterateByDelimiter(result.stdout, '\\0')) {\n\t\t\tif (!line.length) continue;\n\n\t\t\tpaths.push(line);\n\t\t}\n\t\treturn paths;\n\t}\n\n\tprivate async isTrackedWithDetails(\n\t\tfilePath: string,\n\t\trepoPath: string,\n\t\trev?: string,\n\t): Promise<{ path: string; status?: GitFileStatus; originalPath?: string } | undefined> {\n\t\tif (rev === deletedOrMissing) return undefined;\n\n\t\tconst scope = getScopedLogger();\n\n\t\ttry {\n\t\t\tconst [relativePath, root] = splitPath(filePath, repoPath);\n\n\t\t\t// Check if the file exists in the working tree first (better cache reuse)\n\t\t\tlet tracked = await this.revision.exists(root, relativePath);\n\t\t\tif (tracked) return { path: relativePath };\n\n\t\t\t// If a specific revision was provided, check there too\n\t\t\tif (rev && !isUncommitted(rev)) {\n\t\t\t\ttracked = await this.revision.exists(root, relativePath, rev);\n\t\t\t\tif (!tracked) {\n\t\t\t\t\t// Check the parent revision (file might have been deleted in this rev)\n\t\t\t\t\ttracked = await this.revision.exists(root, relativePath, `${rev}^`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn tracked ? { path: relativePath } : undefined;\n\t\t} catch (ex) {\n\t\t\tscope?.error(ex);\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tthis._unregisterListener.dispose();\n\t\tthis._resetListener.dispose();\n\t\tthis._onDidAnnounceChanges.dispose();\n\t\tthis._indexRefresher.dispose();\n\t\tthis._git.dispose();\n\t\tif (this._cacheOwned) {\n\t\t\tthis._cache.dispose();\n\t\t}\n\t}\n}\n\n/**\n * The names in `refs` a sibling worktree hears with the shared part of `changes`: those of a shared ref kind among\n * `changes`. An empty `changes` or `'unknown'` reaches siblings as every shared kind, unnamed, so none.\n */\nfunction getSharedRefs(changes: readonly RepositoryChange[], refs: readonly string[]): string[] | undefined {\n\tif (!changes.length || changes.includes('unknown')) return undefined;\n\n\tconst shared = refs.filter(r => {\n\t\tif (!r.startsWith('refs/')) return false;\n\n\t\tconst kind = getRefChangeKind(r);\n\t\treturn kind != null && changes.includes(kind) && worktreeSharedChanges.has(kind);\n\t});\n\treturn shared.length ? shared : undefined;\n}\n\n/**\n * Resolves a pathname config value the way git does: a leading `~/` (or a bare `~`) is the home directory, and a\n * relative path is taken from the repository root. Done here rather than with `git config --type=path`, which needs\n * git 2.18, newer than the minimum supported version.\n */\nfunction resolveGitPathConfig(\n\tvalue: string,\n\trepoPath: string,\n\tgitEnv: Readonly<Record<string, string | undefined>>,\n): string | undefined {\n\tif (value === '~' || value.startsWith('~/')) {\n\t\tconst home = gitEnv.HOME;\n\t\tif (home == null) return undefined;\n\t\tif (value === '~') return home || undefined;\n\n\t\treturn path.join(home || path.sep, value.substring(2));\n\t}\n\n\treturn path.resolve(repoPath, value);\n}\n\nfunction parseIgnoreCase(value: string | undefined): boolean | undefined {\n\tif (value == null) return undefined;\n\tif (parseGitBoolean(value)) return true;\n\n\treturn isGitBooleanFalse(value) ? false : undefined;\n}\n\nfunction foldGitPathCase(name: string): string {\n\t// KEEP: Git's C-locale pathspec matching folds only ASCII.\n\treturn name.replace(/[A-Z]/g, c => c.toLowerCase());\n}\n\n/** Where git reads global excludes when `core.excludesFile` is unset: `$XDG_CONFIG_HOME/git/ignore`, else `$HOME/.config/git/ignore` */\nfunction getDefaultGlobalExcludesPath(gitEnv: Readonly<Record<string, string | undefined>>): string | undefined {\n\tconst xdgConfigHome = gitEnv.XDG_CONFIG_HOME;\n\tif (xdgConfigHome) return path.join(xdgConfigHome, 'git', 'ignore');\n\n\tconst home = gitEnv.HOME ?? (isWindows ? homedir() : undefined);\n\treturn home == null ? undefined : path.join(home || path.sep, '.config', 'git', 'ignore');\n}\n\n/**\n * The folder of a path git refused for a symlink or submodule in its leading folders, where every other path is refused\n * too; none for a top-level path, or one with `.` or `..` segments, whose folder git would read otherwise\n */\nfunction getRefusedFolder(refused: string): string | undefined {\n\tconst trimmed = trimTrailingSlashes(refused);\n\tif (hasDotSegment(trimmed)) return undefined;\n\n\tconst index = trimmed.lastIndexOf('/');\n\treturn index > 0 ? trimmed.substring(0, index + 1) : undefined;\n}\n\nfunction hasDotSegment(p: string): boolean {\n\treturn /(?:^|\\/)\\.\\.?(?:\\/|$)/.test(p);\n}\n\n/** Whether a folder holds a file or symlink anywhere below it, as git lists no folder without one; an unreadable folder holds none */\nasync function hasNonDirectoryEntry(folder: string): Promise<boolean> {\n\tconst pending = [folder];\n\twhile (pending.length) {\n\t\tconst current = pending.pop()!;\n\t\ttry {\n\t\t\tfor (const entry of await fs.readdir(current, { withFileTypes: true })) {\n\t\t\t\tif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7 +1,7 @@
1
1
  {
2
2
  "name": "@gitkraken/core-gitlens",
3
3
  "description": "GitLens core — shared Git / AI / GitHub primitives for internal GitKraken consumption",
4
- "version": "0.64.0",
4
+ "version": "0.64.1",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": {
7
7
  "name": "GitKraken",