@gitkraken/core-gitlens 0.16.5 → 0.18.0
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 +35 -1
- package/dist/git/cache.d.ts +15 -2
- package/dist/git/cache.js +36 -9
- package/dist/git/cache.js.map +1 -1
- package/dist/git/models/repository.d.ts +4 -2
- package/dist/git/models/repository.js +1 -0
- package/dist/git/models/repository.js.map +1 -1
- package/dist/git/models/worktree.d.ts +5 -1
- package/dist/git/models/worktree.js +5 -3
- package/dist/git/models/worktree.js.map +1 -1
- package/dist/git/providers/provider.d.ts +17 -0
- package/dist/git/providers/worktrees.d.ts +17 -2
- package/dist/git/run.types.d.ts +7 -0
- package/dist/git/service.d.ts +5 -2
- package/dist/git/service.js +11 -5
- package/dist/git/service.js.map +1 -1
- package/dist/git/watching/classifyChange.d.ts +4 -3
- package/dist/git/watching/classifyChange.js +7 -4
- package/dist/git/watching/classifyChange.js.map +1 -1
- package/dist/git/watching/gitIgnoreFilter.d.ts +21 -3
- package/dist/git/watching/gitIgnoreFilter.js +74 -14
- package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
- package/dist/git/watching/provider.d.ts +14 -0
- package/dist/git/watching/watchGroup.d.ts +142 -3
- package/dist/git/watching/watchGroup.js +424 -19
- package/dist/git/watching/watchGroup.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +39 -1
- package/dist/git/watching/watchService.js +81 -20
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +13 -8
- package/dist/git/watching/watchSession.js +50 -10
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git/watching/watcherPatterns.d.ts +14 -0
- package/dist/git/watching/watcherPatterns.js +38 -1
- package/dist/git/watching/watcherPatterns.js.map +1 -1
- package/dist/git/watching/worktreeSummary.d.ts +97 -7
- package/dist/git/watching/worktreeSummary.js +454 -27
- package/dist/git/watching/worktreeSummary.js.map +1 -1
- package/dist/git-cli/cliGitProvider.d.ts +26 -0
- package/dist/git-cli/cliGitProvider.js +70 -9
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/exec/commandClassifier.d.ts +9 -3
- package/dist/git-cli/exec/commandClassifier.js +98 -17
- package/dist/git-cli/exec/commandClassifier.js.map +1 -1
- package/dist/git-cli/exec/git.d.ts +20 -0
- package/dist/git-cli/exec/git.js +69 -7
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/headState.d.ts +5 -0
- package/dist/git-cli/exec/headState.js +14 -1
- package/dist/git-cli/exec/headState.js.map +1 -1
- package/dist/git-cli/parsers/worktreeParser.js +2 -2
- package/dist/git-cli/parsers/worktreeParser.js.map +1 -1
- package/dist/git-cli/providers/branches.js +9 -36
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +21 -0
- package/dist/git-cli/providers/config.js +72 -1
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/graph.js +1 -1
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +3 -0
- package/dist/git-cli/providers/operations.js +14 -5
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/worktrees.d.ts +25 -3
- package/dist/git-cli/providers/worktrees.js +125 -32
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/git-cli/service.d.ts +2 -0
- package/dist/git-cli/service.js +4 -2
- package/dist/git-cli/service.js.map +1 -1
- package/dist/plus/integrations/providers/issueSorts.d.ts +0 -1
- package/dist/plus/integrations/reads/drains.d.ts +0 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,38 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.18.0] - 2026-10-25
|
|
10
|
+
|
|
11
|
+
## [0.17.0] - 2026-10-25
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- Adds `ignoredWorktreeFolders` to `CliGitProviderOptions` and `createCliGitService`: folders, relative to a repository's common git dir, whose worktrees core acts as if didn't exist, for a tool's throwaway worktrees (sync-tools' `sync-tools-worktrees`, say). They are matched under the common git dir as spelled and as it resolves through symlinks. They are left out of worktree lists, and adding, removing, locking, unlocking or moving one (by absolute path, in a `notify: 'infer'` run; the typed worktree writes still announce it) announces no `worktrees` change, so it no longer evicts every checkout's cached git results. The `.git` watchers leave the folders unwatched, so a throwaway checkout inside `.git` costs the watcher nothing. Nothing is ignored unless registered (git, git-cli)
|
|
16
|
+
- Adds `readDirectory` to `GitService.createSingleton`'s options, shaped like `FileSystemProvider.readDirectory`, which `createCliGitService` passes from the host's file system. With it and `readFile`, the watcher lists and reads a repository's worktree admin entries once as it starts, so an ignored worktree's reports, every HEAD move of a rebase in one included, reach no session, while a known worktree's reports are told at once without a read (git, git-cli)
|
|
17
|
+
- Adds `WorktreeSummaryService.getSummarySnapshot(repoPath, { probeDirty?, cancellation? })`, which answers a worktree's summary with `dirtyReadAt`, when its dirty flag was read: `undefined` for a subscribed worktree, whose summary follows its working tree. For a worktree without a subscription, `probeDirty` reads the dirty flag whatever its inputs say (git)
|
|
18
|
+
- Adds `onDidStart` to `FileWatcherOptions`, passed to working-tree watchers only, with or without polling: a provider that places its watch asynchronously calls it once the watch is live, and core rescans the working tree once for whatever changed meanwhile (git)
|
|
19
|
+
- Adds `stat` to `WorktreeSummaryServiceOptions`, which `GitService` fills from `watchPolling.stat`: with it, a worktree without a subscription re-reads its dirty flag only when its index file moved (git)
|
|
20
|
+
- Adds `GitWorktree.branchName`: the branch `git worktree list` names, set even when the branch list has no match for it, which `GitWorktree.name` now falls back to (git, git-cli)
|
|
21
|
+
- Adds a `force` option to `worktrees.getWorktrees(repoPath, options?, cancellation?)` and `worktrees.getWorktree(repoPath, predicate, options?, cancellation?)`: it re-reads `git worktree list` and evicts only the cached worktree list, for the repository and its sibling worktrees, unless a read whose git process hasn't started yet is pending, which it joins. Clearing the `'worktrees'` and `'branches'` cache types to get a fresh list made every sibling worktree re-run its branch, ref and log reads (git, git-cli)
|
|
22
|
+
- Adds `onSpawn` to `GitRunOptions`, called once when the git process starts, after any wait in core's queue; a call sharing an identical run in flight is told when that run starts (git, git-cli)
|
|
23
|
+
- Adds the `'worktreeHead'` repository change, a linked worktree's HEAD moving (a checkout in a worktree whose own `.git` isn't watched), which the `.git` watchers report beside `'worktrees'` for a worktree's `HEAD` and for an admin entry created or removed (a watcher may report a removal as its directory alone), and `git worktree add`, `remove` and `prune` (typed or `notify: 'infer'`) announce; and the `'worktreeList'` cache type, which evicts only the cached worktree list, for the repository and its sibling worktrees (git, git-cli)
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- **Breaking (git, git-cli)** — `worktrees.getWorktrees` and `worktrees.getWorktree` take `options` before `cancellation`, `getWorktrees(repoPath, options?, cancellation?)` and `getWorktree(repoPath, predicate, options?, cancellation?)`, like `branches.getBranch`. A caller passing a cancellation positionally must move it
|
|
28
|
+
- **Breaking (git, git-cli)** — `RepositoryChange` gains `'worktreeHead'` and `CachedGitTypes` gains `'worktreeList'`, which breaks a host's exhaustive `switch` or `Record` over either. A host that refreshed on a linked worktree's checkout by `'worktrees'` still hears it, since its report carries both
|
|
29
|
+
- Changes a lock or unlock of a worktree, typed or raw, a raw `git worktree move` or `repair`, and a watcher's report of a worktree's `locked` file, a `gitdir` written or an admin entry's directory changed, to evict only the cached worktree list rather than every worktree's cached git results and merge targets. An add, remove or prune, or a worktree's HEAD moving, still evicts them all (git, git-cli)
|
|
30
|
+
- Changes a `'providers'`-only cache reset, which only touches remote-provider metadata, to leave in-flight git runs joinable in core's typed writes and `notifyChanged`, as it already did in GitLens (git, git-cli)
|
|
31
|
+
- Changes a checkout, switch, rebase, bisect or `stash branch` core runs (typed or `notify: 'infer'`), and its move of a detached HEAD, to announce `'worktrees'` and `'worktreeHead'` beside its own kinds, so every other worktree takes the watchers' report of the rewritten HEAD for the write's own: it no longer hears it a second time as an outside change, nor evicts every worktree's cached git results again for it. A commit on a branch, which leaves the HEAD file as it was, announces neither (git-cli)
|
|
32
|
+
- Changes `getSummary` of a worktree without a subscription to answer from its last read, kept for the 256 most recently asked, rather than reading every field afresh each time (4 to 7 git processes): it re-reads only what its inputs say moved since, all of them read from core's caches, so nothing moved means no git. HEAD's branch or commit moving reads everything; the upstream's tip or name, the branch; a ref the base depends on (for a remote's `HEAD` symref, where it points), the base, re-measured from the previous one as for a subscribed worktree; the config inputs the base read consulted, the branch and the base; the index file (with `stat`), the dirty flag; and core's own write of the branch's merge target or base, the stored base values. Only a `.git` watch of the worktree (or core's own writes) keeps those caches current, so a host watches the `.git` of a worktree it asks about. Concurrent reads of one worktree share a read, which still takes no read slot, so it never waits behind subscribed worktrees' runs; a caller after core's write of a merge target or base gets a read of its own. A subscription drops the last read, and so does a failed read (git)
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- Fixes a write that creates or removes the directory holding its ref (the first `team/…` branch, say) also reaching watchers as an outside change of every branch: the watcher's report of that directory is now the write's own (git)
|
|
37
|
+
- Fixes the first move of a base after a clone, or after the reflog lost the entries before it, re-measuring every worktree in full instead of in one shared read (git-cli)
|
|
38
|
+
- Fixes a worktree list pairing a worktree with no branch, or a stale one, after a change the branch caches missed (a branch `git worktree add -b` created outside core, a worktree that switched branches, a commit), so a `pull` of a branch checked out in another worktree fetched into it and failed: where `git worktree list` contradicts the cached branch list, core re-reads the branches once, first dropping the branch caches of a worktree whose branch changed, and announces an unnamed `heads` change so a host's views of the branches refresh too. A contradiction the fresh branch list still shows (a layout where git's two listings never agree) isn't re-read again until the worktree list changes (git-cli)
|
|
39
|
+
- Fixes a worktree whose HEAD points outside `refs/heads/` getting a garbled branch name; it has none (git-cli)
|
|
40
|
+
|
|
9
41
|
## [0.16.5] - 2026-10-24
|
|
10
42
|
|
|
11
43
|
### Added
|
|
@@ -926,7 +958,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
926
958
|
|
|
927
959
|
- 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.
|
|
928
960
|
|
|
929
|
-
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.
|
|
961
|
+
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.18.0...HEAD
|
|
962
|
+
[0.18.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.17.0...gitkraken:releases/core/v0.18.0
|
|
963
|
+
[0.17.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.16.5...gitkraken:releases/core/v0.17.0
|
|
930
964
|
[0.16.5]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.16.4...gitkraken:releases/core/v0.16.5
|
|
931
965
|
[0.16.4]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.16.3...gitkraken:releases/core/v0.16.4
|
|
932
966
|
[0.16.3]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.16.2...gitkraken:releases/core/v0.16.3
|
package/dist/git/cache.d.ts
CHANGED
|
@@ -31,7 +31,11 @@ type RepoPath = string;
|
|
|
31
31
|
/** Cache types that are keyed by file path within a repo — support per-file clearing */
|
|
32
32
|
export type UriScopedCachedGitTypes = 'blame' | 'diff' | 'fileLog';
|
|
33
33
|
export declare function areUriScopedCachedGitTypes(types: string[]): types is UriScopedCachedGitTypes[];
|
|
34
|
-
export type CachedGitTypes = UriScopedCachedGitTypes | 'branch' | 'branches' | 'config' | 'contributors' | 'gitignore' | 'gkConfig' | 'lastFetched' | 'providers' | 'remotes' | 'stashes' | 'status' | 'tags' | 'tracking' | 'worktrees'
|
|
34
|
+
export type CachedGitTypes = UriScopedCachedGitTypes | 'branch' | 'branches' | 'config' | 'contributors' | 'gitignore' | 'gkConfig' | 'lastFetched' | 'providers' | 'remotes' | 'stashes' | 'status' | 'tags' | 'tracking' | 'worktrees' |
|
|
35
|
+
/** Only the worktree list: unlike `'worktrees'`, no worktree's git results or merge targets */
|
|
36
|
+
'worktreeList';
|
|
37
|
+
/** Whether a reset of these types makes in-flight git runs stale (none or empty meaning every type) */
|
|
38
|
+
export declare function resetDropsPendingRuns(types: readonly CachedGitTypes[] | undefined): boolean;
|
|
35
39
|
/**
|
|
36
40
|
* What a gk-config reconcile did, so `Cache` knows whether the coarse fallback is still owed.
|
|
37
41
|
*
|
|
@@ -187,6 +191,7 @@ export declare class Cache implements Disposable {
|
|
|
187
191
|
get gitDir(): Map<RepoPath, GitDir>;
|
|
188
192
|
get gitIgnore(): Map<RepoPath, GitIgnoreFilter>;
|
|
189
193
|
get gitResults(): RepoPromiseCacheMap<RepoPath, GitResult>;
|
|
194
|
+
get ignoreConfigListing(): PromiseMap<RepoPath, string | undefined>;
|
|
190
195
|
get initialCommitSha(): PromiseMap<RepoPath, string | undefined>;
|
|
191
196
|
get lastFetched(): PromiseCache<RepoPath, number | undefined>;
|
|
192
197
|
get leftRightCommitCount(): RepoPromiseCacheMap<string, LeftRightCommitCountResult | undefined>;
|
|
@@ -484,6 +489,12 @@ export declare class Cache implements Disposable {
|
|
|
484
489
|
* before it.
|
|
485
490
|
*/
|
|
486
491
|
getAheadOfBaseConfigListing(repoPath: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<string | undefined>, cancellation?: AbortSignal): Promise<string | undefined>;
|
|
492
|
+
/**
|
|
493
|
+
* One listing of the gitignore filter's config inputs for every checkout of a repository, which serves a checkout's
|
|
494
|
+
* filter while nothing makes config differ by checkout. Evicted hard, so a read after a change never joins one
|
|
495
|
+
* from before it.
|
|
496
|
+
*/
|
|
497
|
+
getIgnoreConfigListing(repoPath: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<string | undefined>, cancellation?: AbortSignal): Promise<string | undefined>;
|
|
487
498
|
getBranchMetadataMap(repoPath: string, factory: (commonPath: string) => PromiseOrValue<Map<string, BranchMetadata>>): Promise<Map<string, BranchMetadata>>;
|
|
488
499
|
getDefaultBranchName(repoPath: string, remote: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<string | undefined>, cancellation?: AbortSignal): Promise<string | undefined>;
|
|
489
500
|
/** The cached default branch for one `remote` key, without reading it; `undefined` when none is cached */
|
|
@@ -513,7 +524,9 @@ export declare class Cache implements Disposable {
|
|
|
513
524
|
cancellation?: AbortSignal;
|
|
514
525
|
}): Promise<GitStash>;
|
|
515
526
|
getTags(repoPath: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<PagedResult<GitTag>>, cancellation?: AbortSignal): Promise<PagedResult<GitTag>>;
|
|
516
|
-
getWorktrees(repoPath: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<GitWorktree[]>,
|
|
527
|
+
getWorktrees(repoPath: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<GitWorktree[]>, options?: {
|
|
528
|
+
force?: boolean;
|
|
529
|
+
}, cancellation?: AbortSignal): Promise<GitWorktree[]>;
|
|
517
530
|
private getSharedOrCreate;
|
|
518
531
|
private getSharedOrCreateWithKey;
|
|
519
532
|
private getSharedSimple;
|
package/dist/git/cache.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { exhaustiveArray } from "../utils/array.js";
|
|
2
|
-
import { raceWithSignal } from "../utils/cancellation.js";
|
|
2
|
+
import { CancellationError, raceWithSignal } from "../utils/cancellation.js";
|
|
3
3
|
import { debug } from "../utils/decorators/log.js";
|
|
4
4
|
import { invalidateMemoized } from "../utils/decorators/memoize.js";
|
|
5
5
|
import { Emitter } from "../utils/event.js";
|
|
@@ -19,6 +19,10 @@ const uriScopedCachedGitTypes = [
|
|
|
19
19
|
function areUriScopedCachedGitTypes(types) {
|
|
20
20
|
return types.every((t) => uriScopedCachedGitTypes.includes(t));
|
|
21
21
|
}
|
|
22
|
+
/** Whether a reset of these types makes in-flight git runs stale (none or empty meaning every type) */
|
|
23
|
+
function resetDropsPendingRuns(types) {
|
|
24
|
+
return !types?.length || types.some((t) => t !== "worktreeList" && t !== "providers");
|
|
25
|
+
}
|
|
22
26
|
/**
|
|
23
27
|
* Ceiling on how long a derived branch base is trusted. Long enough that repeated reads during normal use
|
|
24
28
|
* are served from cache, short enough that a base that changed by a route with no eviction signal (an
|
|
@@ -69,6 +73,7 @@ const sharedCacheKeys = new Set(exhaustiveArray()([
|
|
|
69
73
|
"emptyTreeSha",
|
|
70
74
|
"gitResults",
|
|
71
75
|
"gkConfigMap",
|
|
76
|
+
"ignoreConfigListing",
|
|
72
77
|
"initialCommitSha",
|
|
73
78
|
"lastFetched",
|
|
74
79
|
"logShas",
|
|
@@ -117,6 +122,7 @@ function createEmptyCaches() {
|
|
|
117
122
|
gitIgnore: void 0,
|
|
118
123
|
gitResults: void 0,
|
|
119
124
|
gkConfigMap: void 0,
|
|
125
|
+
ignoreConfigListing: void 0,
|
|
120
126
|
initialCommitSha: void 0,
|
|
121
127
|
lastFetched: void 0,
|
|
122
128
|
logShas: void 0,
|
|
@@ -298,6 +304,9 @@ var Cache = class Cache {
|
|
|
298
304
|
get gitResults() {
|
|
299
305
|
return this._caches.gitResults ??= new RepoPromiseCacheMap({ capacity: 200 });
|
|
300
306
|
}
|
|
307
|
+
get ignoreConfigListing() {
|
|
308
|
+
return this._caches.ignoreConfigListing ??= new PromiseMap();
|
|
309
|
+
}
|
|
301
310
|
get initialCommitSha() {
|
|
302
311
|
return this._caches.initialCommitSha ??= new PromiseMap();
|
|
303
312
|
}
|
|
@@ -438,6 +447,7 @@ var Cache = class Cache {
|
|
|
438
447
|
if (types.includes("branch")) {
|
|
439
448
|
keysToClear.add("aheadOfBaseConfigKey");
|
|
440
449
|
keysToClear.add("aheadOfBaseConfigListing");
|
|
450
|
+
keysToClear.add("ignoreConfigListing");
|
|
441
451
|
keysToClear.add("baseBranchName");
|
|
442
452
|
}
|
|
443
453
|
if (!worktreeOnly && (types.includes("branch") || types.includes("worktrees"))) this.evictMergeTargetsOnCheckout(repoPath);
|
|
@@ -454,6 +464,7 @@ var Cache = class Cache {
|
|
|
454
464
|
if (types.includes("config")) {
|
|
455
465
|
keysToClear.add("aheadOfBaseConfigKey");
|
|
456
466
|
keysToClear.add("aheadOfBaseConfigListing");
|
|
467
|
+
keysToClear.add("ignoreConfigListing");
|
|
457
468
|
keysToClear.add("baseBranchName");
|
|
458
469
|
keysToClear.add("configKeys");
|
|
459
470
|
keysToClear.add("configPatterns");
|
|
@@ -503,8 +514,8 @@ var Cache = class Cache {
|
|
|
503
514
|
keysToClear.add("fileExistence");
|
|
504
515
|
keysToClear.add("trackedPaths");
|
|
505
516
|
}
|
|
506
|
-
if (types.includes("worktrees")) keysToClear.add("worktrees");
|
|
507
|
-
if (types.some((t) => t !== "gitignore" && t !== "gkConfig" && t !== "providers")) keysToClear.add("gitResults");
|
|
517
|
+
if (types.includes("worktrees") || types.includes("worktreeList")) keysToClear.add("worktrees");
|
|
518
|
+
if (types.some((t) => t !== "gitignore" && t !== "gkConfig" && t !== "providers" && t !== "worktreeList")) keysToClear.add("gitResults");
|
|
508
519
|
}
|
|
509
520
|
for (const key of keysToClear) {
|
|
510
521
|
const cache = this._caches[key];
|
|
@@ -513,7 +524,7 @@ var Cache = class Cache {
|
|
|
513
524
|
else if (key === "aheadOfBaseConfigKey" && !worktreeOnly && (!types.length || types.includes("config"))) this.evictShared(key, repoPath, "evict");
|
|
514
525
|
else if (sharedCacheKeys.has(key)) {
|
|
515
526
|
if (!worktreeOnly) {
|
|
516
|
-
const hardEvict = key === "aheadOfBaseConfigListing" || key === "gitResults" && (types.includes("config") || types.includes("branch"));
|
|
527
|
+
const hardEvict = key === "aheadOfBaseConfigListing" || key === "ignoreConfigListing" || key === "gitResults" && (types.includes("config") || types.includes("branch"));
|
|
517
528
|
this.evictShared(key, repoPath, hardEvict ? "evict" : inFlight);
|
|
518
529
|
}
|
|
519
530
|
} else cache.delete(repoPath);
|
|
@@ -626,7 +637,10 @@ var Cache = class Cache {
|
|
|
626
637
|
if (previousCommonPath != null && previousCommonPath !== commonPath) this.unregisterRepoPath(normalizedPath);
|
|
627
638
|
if (previousCommonPath !== commonPath) {
|
|
628
639
|
this._caches.aheadOfBaseConfigKey?.delete(normalizedPath);
|
|
629
|
-
if (normalizedPath === commonPath)
|
|
640
|
+
if (normalizedPath === commonPath) {
|
|
641
|
+
this._caches.aheadOfBaseConfigListing?.delete(commonPath);
|
|
642
|
+
this._caches.ignoreConfigListing?.delete(commonPath);
|
|
643
|
+
}
|
|
630
644
|
this._caches.gitResults?.delete(normalizedPath);
|
|
631
645
|
}
|
|
632
646
|
this._commonPathRegistry.set(normalizedPath, commonPath);
|
|
@@ -670,7 +684,7 @@ var Cache = class Cache {
|
|
|
670
684
|
if (key === "gitResults" && isLastWorktree && repoPath !== commonPath) cache.delete(commonPath);
|
|
671
685
|
continue;
|
|
672
686
|
}
|
|
673
|
-
if (key === "aheadOfBaseConfigListing") {
|
|
687
|
+
if (key === "aheadOfBaseConfigListing" || key === "ignoreConfigListing") {
|
|
674
688
|
if (repoPath === commonPath || isLastWorktree) cache.delete(commonPath);
|
|
675
689
|
continue;
|
|
676
690
|
}
|
|
@@ -759,7 +773,8 @@ var Cache = class Cache {
|
|
|
759
773
|
}
|
|
760
774
|
if (hasAny("stash")) types.add("stashes");
|
|
761
775
|
if (hasAny("tags")) types.add("tags");
|
|
762
|
-
if (hasAny("
|
|
776
|
+
if (hasAny("worktreeHead")) types.add("worktrees");
|
|
777
|
+
else if (hasAny("worktrees")) types.add("worktreeList");
|
|
763
778
|
if (types.size) this.clearCachesCore(inFlight, repoPath, [...types], worktreeOnly);
|
|
764
779
|
return [...types];
|
|
765
780
|
}
|
|
@@ -1183,6 +1198,14 @@ var Cache = class Cache {
|
|
|
1183
1198
|
getAheadOfBaseConfigListing(repoPath, factory, cancellation) {
|
|
1184
1199
|
return this.getSharedSimple(this.aheadOfBaseConfigListing, repoPath, factory, cancellation);
|
|
1185
1200
|
}
|
|
1201
|
+
/**
|
|
1202
|
+
* One listing of the gitignore filter's config inputs for every checkout of a repository, which serves a checkout's
|
|
1203
|
+
* filter while nothing makes config differ by checkout. Evicted hard, so a read after a change never joins one
|
|
1204
|
+
* from before it.
|
|
1205
|
+
*/
|
|
1206
|
+
getIgnoreConfigListing(repoPath, factory, cancellation) {
|
|
1207
|
+
return this.getSharedSimple(this.ignoreConfigListing, repoPath, factory, cancellation);
|
|
1208
|
+
}
|
|
1186
1209
|
getBranchMetadataMap(repoPath, factory) {
|
|
1187
1210
|
return this.getSharedSimple(this.branchMetadataMap, repoPath, factory);
|
|
1188
1211
|
}
|
|
@@ -1279,7 +1302,11 @@ var Cache = class Cache {
|
|
|
1279
1302
|
values: data.values.map((t) => t.withRepoPath(newRepoPath))
|
|
1280
1303
|
}), cancellation);
|
|
1281
1304
|
}
|
|
1282
|
-
async getWorktrees(repoPath, factory, cancellation) {
|
|
1305
|
+
async getWorktrees(repoPath, factory, options, cancellation) {
|
|
1306
|
+
if (options?.force) {
|
|
1307
|
+
if (cancellation?.aborted) throw new CancellationError();
|
|
1308
|
+
this.evictCaches(repoPath, "worktreeList");
|
|
1309
|
+
}
|
|
1283
1310
|
return this.getSharedOrCreate(this.worktrees, repoPath, factory, (data, newRepoPath) => data.map((w) => w.withRepoPath(newRepoPath)), cancellation);
|
|
1284
1311
|
}
|
|
1285
1312
|
async getSharedOrCreate(cache, repoPath, factory, mapper, cancellation) {
|
|
@@ -1345,6 +1372,6 @@ __decorate([debug({ onlyExit: true })], Cache.prototype, "reset", null);
|
|
|
1345
1372
|
__decorate([debug({ onlyExit: true })], Cache.prototype, "onRepositoryChanged", null);
|
|
1346
1373
|
__decorate([debug({ onlyExit: true })], Cache.prototype, "applyRepositoryChanges", null);
|
|
1347
1374
|
//#endregion
|
|
1348
|
-
export { Cache, areUriScopedCachedGitTypes, shouldEvictBlameCacheEntry };
|
|
1375
|
+
export { Cache, areUriScopedCachedGitTypes, resetDropsPendingRuns, shouldEvictBlameCacheEntry };
|
|
1349
1376
|
|
|
1350
1377
|
//# sourceMappingURL=cache.js.map
|