@gitkraken/core-gitlens 0.15.7 → 0.16.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 +25 -1
- package/dist/git/cache.d.ts +13 -0
- package/dist/git/cache.js +45 -8
- package/dist/git/cache.js.map +1 -1
- package/dist/git/features.d.ts +1 -1
- package/dist/git/features.js +1 -0
- package/dist/git/features.js.map +1 -1
- package/dist/git/providers/branches.d.ts +29 -0
- package/dist/git/run.types.d.ts +3 -0
- package/dist/git/service.d.ts +4 -2
- package/dist/git/service.js +6 -4
- package/dist/git/service.js.map +1 -1
- package/dist/git/watching/classifyChange.js +3 -0
- package/dist/git/watching/classifyChange.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +2 -0
- package/dist/git/watching/watchSession.js +9 -1
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git/watching/worktreeSummary.d.ts +19 -4
- package/dist/git/watching/worktreeSummary.js +121 -36
- package/dist/git/watching/worktreeSummary.js.map +1 -1
- package/dist/git-cli/cliGitProvider.d.ts +1 -1
- package/dist/git-cli/cliGitProvider.js +8 -5
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/exec/commandClassifier.d.ts +18 -3
- package/dist/git-cli/exec/commandClassifier.js +562 -16
- package/dist/git-cli/exec/commandClassifier.js.map +1 -1
- package/dist/git-cli/exec/exec.d.ts +2 -2
- package/dist/git-cli/exec/git.d.ts +31 -4
- package/dist/git-cli/exec/git.js +105 -43
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/headState.d.ts +32 -0
- package/dist/git-cli/exec/headState.js +78 -0
- package/dist/git-cli/exec/headState.js.map +1 -0
- package/dist/git-cli/providers/branches.d.ts +50 -0
- package/dist/git-cli/providers/branches.js +294 -25
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/config.js +3 -2
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +6 -7
- package/dist/git-cli/providers/operations.js +46 -64
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/refs.d.ts +4 -1
- package/dist/git-cli/providers/refs.js +13 -9
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/revision.js +1 -1
- package/dist/git-cli/providers/stash.js +1 -1
- package/dist/git-cli/providers/worktrees.js +23 -6
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/git-cli/service.d.ts +3 -0
- package/dist/git-cli/service.js +1 -0
- package/dist/git-cli/service.js.map +1 -1
- package/dist/utils/env/node/exec.d.ts +38 -1
- package/dist/utils/env/node/exec.js +14 -6
- package/dist/utils/env/node/exec.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,28 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.16.1] - 2026-10-23
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Adds `GitOptions.spawn`, which launches the git process of every run and stream in place of Node's `spawn` (locating git still uses `execFile`), so a host whose process is large can start git from a helper process: on Linux a spawn forks the calling process, blocking its event loop for a time that grows with its memory. Exports `ProcessSpawner`, `ProcessSpawnOptions` and `SpawnedProcess` for it (git-cli, utils)
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Fixes a fetch that moves a remote-tracking ref making every worktree that asks for its push target re-run `rev-parse` to find its checked-out branch, one git process per worktree on top of the one shared ref list read: `getPushTarget` without a branch now takes the branch from the worktree's own `HEAD` file, so it runs no git process and is never older than the file. A `HEAD` file that can't say (reftable, an unreadable file, a branch that is a symbolic ref to another, such as a `master` kept pointing at `main`, or a HEAD kept as a symlink by `core.preferSymlinkRefs`, which reads as an object id like a detached HEAD but which the git dir's listing flags as a link) resolves the branch with git as before (git, git-cli)
|
|
18
|
+
- Fixes a raw git write run with `notify: 'infer'` (a sync rebase, a compose run or an undo) making every worktree of the repository re-read its refs, because it announced whole ref kinds with no names: such a write now names the refs its argv proves it moved, as typed writes do since 0.15.5, so a host can skip worktrees that don't follow them. `update-ref` names its ref, and a write to a ref outside `refs/heads`, `refs/tags`, `refs/remotes` and `refs/stash` (a tool's own bookkeeping, such as `refs/undo/*`) announces nothing, as `updateReference` already did, and the file watcher no longer reports such a ref as an index, config or `HEAD` change when its name holds one of those words (`refs/kepler/sync/resolved/fix-index`); `branch`, `tag`, `checkout -b`/`switch -c`, `worktree add -b` and a plain `checkout <name>` name their branch or tag, with a branch's config change confined to its own section; `stash` writes name `refs/stash` (and `stash branch` the branch it creates), and `stash create` and `stash apply` move no ref; a detached checkout, a full-SHA checkout and every `worktree` subcommand other than `add` announce no branch. A `commit`, `reset`, `merge`, `cherry-pick`, `revert` or `am`, and a `rebase` with update-refs provably off, read the worktree's `HEAD` file before and after the run, without running git: on one branch both times they name it, and detached both times (a sync's scratch worktree) they announce no branch move at all; a `HEAD` kept as a symlink by `core.preferSymlinkRefs`, which reads as its branch's object id as a detached one does, counts as neither, so its branch move is announced unnamed. Anything the argv can't prove (`update-ref --stdin`, a rename of the current branch, a rebase that may update other branches) stays unnamed. With 60 linked worktrees, a sync rebase and apply of one branch went from ~420 git processes to ~65 and its undo from ~385 to ~30, none of them in the other worktrees (git, git-cli)
|
|
19
|
+
- Fixes `updateReference` and `deleteReference` announcing their ref unnamed (a remote's `HEAD`, which an update moves through to the branch it points to, stays unnamed), and typed `reset`, `merge`, `cherryPick` and `revert` announcing their branch unnamed: they now name it, as `commit` does, and a detached HEAD's move announces no branch move. Such a move, raw or typed, still resets that worktree's branch and worktree lists, blame, diffs and contributors (git, git-cli)
|
|
20
|
+
- Fixes `Git.stream` rejecting a stream its own `timeout` killed with a `CancelledRunError` whose reason is `'unknown'` rather than `'timeout'`, so a caller that branches on the reason read it as an outside kill; `run` already reported `'timeout'` (git-cli)
|
|
21
|
+
|
|
22
|
+
## [0.16.0] - 2026-10-22
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- Fixes a fetch that moves a worktree's base (usually `origin/main`) making every worktree summary based on it re-read its base, four or five git processes each: when the base ref is the only dependency that moved, by name, and it only fast-forwarded since the last read (by its reflog, since a commit of the branch's that the base held in between moves the fork point), the summary recounts ahead with one `rev-list --count`, past the new tip, the previous fork point and whatever the base's reflog reaches off the new tip's history, and, when the count is unchanged, keeps the target, tier and fork point, updating only the base's commit. The reflog and ancestry check is shared by every worktree of the repository, and anything else (the branch landing, a force-push, another dependency or an unnamed ref change moving, a base name another ref now also answers to, a remote `HEAD` retargeted so the default branch resolves differently, a fork point the base's reflog supplied, possibly since expired, a reflog entry holding the branch's commits, a shallow repository) re-reads the base in full. Adds an optional `GitBranchesSubProvider.getAheadOfBaseAfterBaseMove` for it, and an optional `AheadOfBase.defaultBranch`, the default branch a read resolved (`null` for none), which the re-measure compares and keeps (git, git-cli)
|
|
27
|
+
- Fixes a `.git/config` write that leaves a worktree's base alone making its summary re-read it anyway, and every checkout list its config: a write confined to another branch's section (a task's new branch) woke no summary but left each one's config key stale, so the next unrelated write (`core.*`) re-read every base, 46 git processes over 8 linked worktrees, and any unconfined write listed the config once per checkout. A summary now keys its base on the remotes, `init.defaultBranch`, conditional includes and the tracking of only the branches its base read depended on, and the checkouts of a repository share one `git config` listing, read in the main checkout, unless it shows config that can differ by checkout (`extensions.worktreeConfig`, or an `includeIf` other than `hasconfig:` and `gitdir:`, such as `onbranch:`), when each checkout lists its own as before. A `gitdir:` include stays shared, as the common identity setup, so an edit to a file only some checkouts include goes unseen there until a change the shared listing sees. That write now costs 3 git processes, an unrelated write lists the config once rather than once per checkout, and a fetch after a write to another branch's section costs each linked worktree 1 process rather than 2 or 3. Adds an optional `GitBranchesSubProvider.getAheadOfBaseConfigEntries`, the entries `getAheadOfBaseConfigKey` is taken from, which a summary filters; with a provider without it, a summary keys on the whole snapshot as before (git, git-cli)
|
|
28
|
+
- Fixes `getConfig` and `getConfigRegex` serving every worktree of a repository the answer of whichever one read first, so with `extensions.worktreeConfig` a worktree's own `config.worktree` values (its user identity or signing settings, read by `getCurrentUser` and `getSigningConfig`, or its pull and rebase settings) were missed or taken from another worktree: both are now cached per worktree, and a config write clears every worktree's entries (git, git-cli)
|
|
29
|
+
- Fixes `createWorktree` announcing nothing about a branch git created on its own, from a branch name that exists only on a remote or, with no commitish, named after the path: it now announces `heads` with the branch's `refs/heads/<name>` and resets the branch and config caches, as with `createBranch`, and leaves the tracking config to the watcher's `.git/config` report. An add cancelled, timed out or refused a retry by the host, whose output (and so the name of any branch git created) is lost, announces `heads` unnamed (git-cli)
|
|
30
|
+
|
|
9
31
|
## [0.15.7] - 2026-10-22
|
|
10
32
|
|
|
11
33
|
### Added
|
|
@@ -862,7 +884,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
862
884
|
|
|
863
885
|
- 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.
|
|
864
886
|
|
|
865
|
-
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.
|
|
887
|
+
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.16.1...HEAD
|
|
888
|
+
[0.16.1]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.16.0...gitkraken:releases/core/v0.16.1
|
|
889
|
+
[0.16.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.7...gitkraken:releases/core/v0.16.0
|
|
866
890
|
[0.15.7]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.6...gitkraken:releases/core/v0.15.7
|
|
867
891
|
[0.15.6]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.5...gitkraken:releases/core/v0.15.6
|
|
868
892
|
[0.15.5]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.4...gitkraken:releases/core/v0.15.5
|
package/dist/git/cache.d.ts
CHANGED
|
@@ -110,6 +110,7 @@ export declare class Cache implements Disposable {
|
|
|
110
110
|
/** Resource usage retained by instantiated sub-caches and their bookkeeping maps. */
|
|
111
111
|
getResourceUsage(): ResourceUsage;
|
|
112
112
|
get aheadOfBaseConfigKey(): PromiseMap<RepoPath, string | undefined>;
|
|
113
|
+
get aheadOfBaseConfigListing(): PromiseMap<RepoPath, string | undefined>;
|
|
113
114
|
get bestRemotes(): PromiseMap<RepoPath, GitRemote<RemoteProvider>[]>;
|
|
114
115
|
get blame(): RepoPromiseCacheMap<string, ProgressiveGitBlame | undefined>;
|
|
115
116
|
get diff(): RepoPromiseCacheMap<string, ParsedGitDiffHunks | undefined>;
|
|
@@ -293,7 +294,13 @@ export declare class Cache implements Disposable {
|
|
|
293
294
|
getGkConfigSnapshot(repoPath: string): ReadonlyMap<string, string> | undefined;
|
|
294
295
|
getBranches(repoPath: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<PagedResult<GitBranch>>, mapper: (branches: PagedResult<GitBranch>, targetRepoPath: string, commonPath: string, cancellation?: AbortSignal) => PromiseOrValue<PagedResult<GitBranch>>, cancellation?: AbortSignal): Promise<PagedResult<GitBranch>>;
|
|
295
296
|
private static readonly globalConfigKey;
|
|
297
|
+
/**
|
|
298
|
+
* Keyed by `repoPath` itself, not its common path: git reads a worktree's own `config.worktree` too, so worktrees
|
|
299
|
+
* of one repository can see different values. A read that is the same for all of them runs from, and passes, the
|
|
300
|
+
* common path. The same holds for {@link getConfigRegex}.
|
|
301
|
+
*/
|
|
296
302
|
getConfig(repoPath: string | undefined, key: string, factory: () => PromiseOrValue<string | undefined>): Promise<string | undefined>;
|
|
303
|
+
/** Keyed by `repoPath` itself, as {@link getConfig} is */
|
|
297
304
|
getConfigRegex(repoPath: string | undefined, pattern: string, factory: () => PromiseOrValue<Map<string, string>>): Promise<Map<string, string>>;
|
|
298
305
|
deleteConfig(repoPath: string | undefined, key: string): void;
|
|
299
306
|
/**
|
|
@@ -425,6 +432,12 @@ export declare class Cache implements Disposable {
|
|
|
425
432
|
getBranchMergedStatus(repoPath: string, cacheKey: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<GitBranchMergedStatus>, cancellation?: AbortSignal): Promise<GitBranchMergedStatus>;
|
|
426
433
|
/** Config can differ by checkout through config.worktree and conditional includes. */
|
|
427
434
|
getAheadOfBaseConfigKey(repoPath: string, factory: (repoPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<string | undefined>, cancellation?: AbortSignal): Promise<string | undefined>;
|
|
435
|
+
/**
|
|
436
|
+
* One listing for every checkout of a repository, which serves a checkout's {@link getAheadOfBaseConfigKey} while
|
|
437
|
+
* nothing makes config differ by checkout. Evicted with it, hard, so a read after a change never joins one from
|
|
438
|
+
* before it.
|
|
439
|
+
*/
|
|
440
|
+
getAheadOfBaseConfigListing(repoPath: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<string | undefined>, cancellation?: AbortSignal): Promise<string | undefined>;
|
|
428
441
|
getBranchMetadataMap(repoPath: string, factory: (commonPath: string) => PromiseOrValue<Map<string, BranchMetadata>>): Promise<Map<string, BranchMetadata>>;
|
|
429
442
|
getDefaultBranchName(repoPath: string, remote: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<string | undefined>, cancellation?: AbortSignal): Promise<string | undefined>;
|
|
430
443
|
/** Clears the cached default branch for one `remote` key (the networked lookup or its `:local` variant). */
|
package/dist/git/cache.js
CHANGED
|
@@ -54,6 +54,7 @@ function getSettledOrPending(cache, key) {
|
|
|
54
54
|
}
|
|
55
55
|
/** Compile-time enforced: adding a key to SharedCaches without listing it here is a type error */
|
|
56
56
|
const sharedCacheKeys = new Set(exhaustiveArray()([
|
|
57
|
+
"aheadOfBaseConfigListing",
|
|
57
58
|
"baseBranchName",
|
|
58
59
|
"branchMergedStatus",
|
|
59
60
|
"branchMetadataMap",
|
|
@@ -82,6 +83,7 @@ const sharedCacheKeys = new Set(exhaustiveArray()([
|
|
|
82
83
|
function createEmptyCaches() {
|
|
83
84
|
return {
|
|
84
85
|
aheadOfBaseConfigKey: void 0,
|
|
86
|
+
aheadOfBaseConfigListing: void 0,
|
|
85
87
|
baseBranchName: void 0,
|
|
86
88
|
bestRemotes: void 0,
|
|
87
89
|
blame: void 0,
|
|
@@ -187,6 +189,9 @@ var Cache = class Cache {
|
|
|
187
189
|
get aheadOfBaseConfigKey() {
|
|
188
190
|
return this._caches.aheadOfBaseConfigKey ??= new PromiseMap();
|
|
189
191
|
}
|
|
192
|
+
get aheadOfBaseConfigListing() {
|
|
193
|
+
return this._caches.aheadOfBaseConfigListing ??= new PromiseMap();
|
|
194
|
+
}
|
|
190
195
|
get bestRemotes() {
|
|
191
196
|
return this._caches.bestRemotes ??= new PromiseMap();
|
|
192
197
|
}
|
|
@@ -420,6 +425,7 @@ var Cache = class Cache {
|
|
|
420
425
|
}
|
|
421
426
|
if (types.includes("branch")) {
|
|
422
427
|
keysToClear.add("aheadOfBaseConfigKey");
|
|
428
|
+
keysToClear.add("aheadOfBaseConfigListing");
|
|
423
429
|
keysToClear.add("baseBranchName");
|
|
424
430
|
}
|
|
425
431
|
if (types.includes("branches")) {
|
|
@@ -434,6 +440,7 @@ var Cache = class Cache {
|
|
|
434
440
|
}
|
|
435
441
|
if (types.includes("config")) {
|
|
436
442
|
keysToClear.add("aheadOfBaseConfigKey");
|
|
443
|
+
keysToClear.add("aheadOfBaseConfigListing");
|
|
437
444
|
keysToClear.add("baseBranchName");
|
|
438
445
|
keysToClear.add("configKeys");
|
|
439
446
|
keysToClear.add("configPatterns");
|
|
@@ -493,7 +500,7 @@ var Cache = class Cache {
|
|
|
493
500
|
else if (key === "aheadOfBaseConfigKey" && !worktreeOnly && (!types.length || types.includes("config"))) this.evictShared(key, repoPath, "evict");
|
|
494
501
|
else if (sharedCacheKeys.has(key)) {
|
|
495
502
|
if (!worktreeOnly) {
|
|
496
|
-
const hardEvict = key === "gitResults" && (types.includes("config") || types.includes("branch"));
|
|
503
|
+
const hardEvict = key === "aheadOfBaseConfigListing" || key === "gitResults" && (types.includes("config") || types.includes("branch"));
|
|
497
504
|
this.evictShared(key, repoPath, hardEvict ? "evict" : inFlight);
|
|
498
505
|
}
|
|
499
506
|
} else cache.delete(repoPath);
|
|
@@ -606,6 +613,7 @@ var Cache = class Cache {
|
|
|
606
613
|
if (previousCommonPath != null && previousCommonPath !== commonPath) this.unregisterRepoPath(normalizedPath);
|
|
607
614
|
if (previousCommonPath !== commonPath) {
|
|
608
615
|
this._caches.aheadOfBaseConfigKey?.delete(normalizedPath);
|
|
616
|
+
if (normalizedPath === commonPath) this._caches.aheadOfBaseConfigListing?.delete(commonPath);
|
|
609
617
|
this._caches.gitResults?.delete(normalizedPath);
|
|
610
618
|
}
|
|
611
619
|
this._commonPathRegistry.set(normalizedPath, commonPath);
|
|
@@ -649,6 +657,10 @@ var Cache = class Cache {
|
|
|
649
657
|
if (key === "gitResults" && isLastWorktree && repoPath !== commonPath) cache.delete(commonPath);
|
|
650
658
|
continue;
|
|
651
659
|
}
|
|
660
|
+
if (key === "aheadOfBaseConfigListing") {
|
|
661
|
+
if (repoPath === commonPath || isLastWorktree) cache.delete(commonPath);
|
|
662
|
+
continue;
|
|
663
|
+
}
|
|
652
664
|
const invalidate = cache.invalidate;
|
|
653
665
|
const evict = typeof invalidate === "function" ? (k) => invalidate.call(cache, k) : (k) => cache.delete(k);
|
|
654
666
|
if (sharedCacheKeys.has(key)) {
|
|
@@ -698,7 +710,7 @@ var Cache = class Cache {
|
|
|
698
710
|
if (hasAny("index", "head", "heads", "remotes", "ignores", "config")) this.incrementStatusGeneration(repoPath);
|
|
699
711
|
const types = /* @__PURE__ */ new Set();
|
|
700
712
|
if (hasAny("head")) types.add("branch");
|
|
701
|
-
if (hasAny("index", "heads", "pausedOp")) {
|
|
713
|
+
if (hasAny("index", "head", "heads", "pausedOp")) {
|
|
702
714
|
types.add("blame");
|
|
703
715
|
types.add("diff");
|
|
704
716
|
types.add("fileLog");
|
|
@@ -709,7 +721,7 @@ var Cache = class Cache {
|
|
|
709
721
|
types.add("branches");
|
|
710
722
|
types.add("worktrees");
|
|
711
723
|
}
|
|
712
|
-
if (hasAny("heads")) {
|
|
724
|
+
if (hasAny("head", "heads")) {
|
|
713
725
|
types.add("branches");
|
|
714
726
|
types.add("contributors");
|
|
715
727
|
types.add("worktrees");
|
|
@@ -809,16 +821,22 @@ var Cache = class Cache {
|
|
|
809
821
|
}, cancellation);
|
|
810
822
|
}
|
|
811
823
|
static globalConfigKey = "";
|
|
824
|
+
/**
|
|
825
|
+
* Keyed by `repoPath` itself, not its common path: git reads a worktree's own `config.worktree` too, so worktrees
|
|
826
|
+
* of one repository can see different values. A read that is the same for all of them runs from, and passes, the
|
|
827
|
+
* common path. The same holds for {@link getConfigRegex}.
|
|
828
|
+
*/
|
|
812
829
|
getConfig(repoPath, key, factory) {
|
|
813
|
-
const cacheKey = repoPath
|
|
830
|
+
const cacheKey = repoPath ?? Cache.globalConfigKey;
|
|
814
831
|
const result = this.configKeys.get(cacheKey, key);
|
|
815
832
|
if (result != null) return result;
|
|
816
833
|
const factoryPromise = Promise.resolve(factory());
|
|
817
834
|
this.configKeys.set(cacheKey, key, factoryPromise);
|
|
818
835
|
return factoryPromise;
|
|
819
836
|
}
|
|
837
|
+
/** Keyed by `repoPath` itself, as {@link getConfig} is */
|
|
820
838
|
getConfigRegex(repoPath, pattern, factory) {
|
|
821
|
-
const cacheKey = repoPath
|
|
839
|
+
const cacheKey = repoPath ?? Cache.globalConfigKey;
|
|
822
840
|
const result = this.configPatterns.get(cacheKey, pattern);
|
|
823
841
|
if (result != null) return result;
|
|
824
842
|
const factoryPromise = Promise.resolve(factory());
|
|
@@ -826,9 +844,20 @@ var Cache = class Cache {
|
|
|
826
844
|
return factoryPromise;
|
|
827
845
|
}
|
|
828
846
|
deleteConfig(repoPath, key) {
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
847
|
+
if (repoPath == null) {
|
|
848
|
+
this._caches.configKeys?.delete(Cache.globalConfigKey, key);
|
|
849
|
+
this._caches.configPatterns?.delete(Cache.globalConfigKey);
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
const commonPath = this.getCommonPath(repoPath);
|
|
853
|
+
for (const path of /* @__PURE__ */ new Set([
|
|
854
|
+
commonPath,
|
|
855
|
+
repoPath,
|
|
856
|
+
...this.getWorktreePaths(commonPath)
|
|
857
|
+
])) {
|
|
858
|
+
this._caches.configKeys?.delete(path, key);
|
|
859
|
+
this._caches.configPatterns?.delete(path);
|
|
860
|
+
}
|
|
832
861
|
}
|
|
833
862
|
/**
|
|
834
863
|
* The whole `.git/gk/config` is read once and cached as a single map per commonPath; per-key and
|
|
@@ -1129,6 +1158,14 @@ var Cache = class Cache {
|
|
|
1129
1158
|
getAheadOfBaseConfigKey(repoPath, factory, cancellation) {
|
|
1130
1159
|
return this.aheadOfBaseConfigKey.getOrCreate(repoPath, (cacheable, signal) => Promise.resolve(factory(repoPath, cacheable, signal)), cancellation);
|
|
1131
1160
|
}
|
|
1161
|
+
/**
|
|
1162
|
+
* One listing for every checkout of a repository, which serves a checkout's {@link getAheadOfBaseConfigKey} while
|
|
1163
|
+
* nothing makes config differ by checkout. Evicted with it, hard, so a read after a change never joins one from
|
|
1164
|
+
* before it.
|
|
1165
|
+
*/
|
|
1166
|
+
getAheadOfBaseConfigListing(repoPath, factory, cancellation) {
|
|
1167
|
+
return this.getSharedSimple(this.aheadOfBaseConfigListing, repoPath, factory, cancellation);
|
|
1168
|
+
}
|
|
1132
1169
|
getBranchMetadataMap(repoPath, factory) {
|
|
1133
1170
|
return this.getSharedSimple(this.branchMetadataMap, repoPath, factory);
|
|
1134
1171
|
}
|