@gitkraken/core-gitlens 0.32.0 → 0.33.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/dist/git/cache.d.ts +90 -15
  3. package/dist/git/cache.js +215 -44
  4. package/dist/git/cache.js.map +1 -1
  5. package/dist/git/models/repositoryIdentities.d.ts +0 -1
  6. package/dist/git/models/repositoryIdentities.js +1 -4
  7. package/dist/git/models/repositoryIdentities.js.map +1 -1
  8. package/dist/git/providers/provider.d.ts +7 -0
  9. package/dist/git/remotes/gitlab.js +15 -9
  10. package/dist/git/remotes/gitlab.js.map +1 -1
  11. package/dist/git/service.js +4 -1
  12. package/dist/git/service.js.map +1 -1
  13. package/dist/git/utils/repository.utils.d.ts +10 -0
  14. package/dist/git/utils/repository.utils.js +25 -2
  15. package/dist/git/utils/repository.utils.js.map +1 -1
  16. package/dist/git/watching/changeEvent.d.ts +13 -3
  17. package/dist/git/watching/changeEvent.js +19 -4
  18. package/dist/git/watching/changeEvent.js.map +1 -1
  19. package/dist/git/watching/watchGroup.d.ts +4 -2
  20. package/dist/git/watching/watchGroup.js +32 -17
  21. package/dist/git/watching/watchGroup.js.map +1 -1
  22. package/dist/git/watching/watchService.d.ts +4 -1
  23. package/dist/git/watching/watchService.js +18 -15
  24. package/dist/git/watching/watchService.js.map +1 -1
  25. package/dist/git/watching/watchSession.d.ts +27 -12
  26. package/dist/git/watching/watchSession.js +49 -19
  27. package/dist/git/watching/watchSession.js.map +1 -1
  28. package/dist/git/watching/worktreeSummary.js +7 -7
  29. package/dist/git/watching/worktreeSummary.js.map +1 -1
  30. package/dist/git-cli/cliGitProvider.d.ts +28 -2
  31. package/dist/git-cli/cliGitProvider.js +62 -19
  32. package/dist/git-cli/cliGitProvider.js.map +1 -1
  33. package/dist/git-cli/exec/git.js +7 -2
  34. package/dist/git-cli/exec/git.js.map +1 -1
  35. package/dist/git-cli/providers/branches.js +15 -10
  36. package/dist/git-cli/providers/branches.js.map +1 -1
  37. package/dist/git-cli/providers/config.d.ts +2 -0
  38. package/dist/git-cli/providers/config.js +19 -8
  39. package/dist/git-cli/providers/config.js.map +1 -1
  40. package/dist/git-cli/providers/worktrees.js +34 -10
  41. package/dist/git-cli/providers/worktrees.js.map +1 -1
  42. package/dist/git-cli/service.js +1 -1
  43. package/dist/git-cli/service.js.map +1 -1
  44. package/dist/plus/integrations/models/integration.js +1 -1
  45. package/dist/plus/integrations/models/integration.js.map +1 -1
  46. package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +10 -0
  47. package/dist/plus/integrations/providers/gitlab/gitlab.js +62 -15
  48. package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -1
  49. package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts +8 -0
  50. package/dist/plus/integrations/providers/gitlab/gitlab.utils.js +32 -16
  51. package/dist/plus/integrations/providers/gitlab/gitlab.utils.js.map +1 -1
  52. package/package.json +1 -1
@@ -183,17 +183,22 @@ const storedMergeKeys = [
183
183
  * `branch`, from the list shared by a repository's worktrees, as `repoPath` sees it. The copy holds the same metadata
184
184
  * object, which `Cache.patchBranchMetadata` updates in place.
185
185
  *
186
- * A list read before a checkout gives the branch now current `worktree: false`. `keepUnlisted` keeps that, so a reader
187
- * of the whole list (`findStaleBranches`) can tell the list is stale; otherwise the current branch names `repoPath`.
186
+ * A list read before a checkout gives the branch now current `worktree: false`, or the worktree it was checked out in
187
+ * then. `keepUnlisted` keeps those placements, so a reader of the whole list (`findStaleBranches`) can tell the list
188
+ * is stale. Otherwise the current branch names `repoPath`, and a branch that isn't current but that the list places at
189
+ * `repoPath` was left by the checkout, so it gets `worktree: false`. `isCurrent` is `undefined` when `repoPath`'s
190
+ * current branch couldn't be read, so the list's placement stands.
188
191
  */
189
192
  function mapSharedBranch(branch, repoPath, commonPath, isCurrent, defaultWorktreePath, keepUnlisted) {
190
- if (!isCurrent && repoPath === commonPath) return branch;
191
193
  let worktree = branch.worktree;
192
- if (isCurrent && (worktree == null || worktree === false && !keepUnlisted)) worktree = {
193
- path: repoPath,
194
- isDefault: repoPath === defaultWorktreePath
195
- };
196
- return new GitBranch(repoPath, branch.refName, isCurrent, branch.date, branch.metadata, branch.sha, branch.upstream, worktree, false, false);
194
+ if (isCurrent) {
195
+ if (worktree == null || !keepUnlisted && (worktree === false || worktree.path !== repoPath)) worktree = {
196
+ path: repoPath,
197
+ isDefault: repoPath === defaultWorktreePath
198
+ };
199
+ } else if (!keepUnlisted && isCurrent === false && worktree !== false && worktree?.path === repoPath) worktree = false;
200
+ if (!isCurrent && repoPath === commonPath && worktree === branch.worktree) return branch;
201
+ return new GitBranch(repoPath, branch.refName, isCurrent ?? false, branch.date, branch.metadata, branch.sha, branch.upstream, worktree, false, false);
197
202
  }
198
203
  var BranchesGitSubProvider = class {
199
204
  context;
@@ -327,7 +332,7 @@ var BranchesGitSubProvider = class {
327
332
  };
328
333
  const branch = values[index];
329
334
  return {
330
- branch: mapSharedBranch(branch, repoPath, commonPath, isCurrent(branch), defaultWorktreePath, false),
335
+ branch: mapSharedBranch(branch, repoPath, commonPath, currentRef != null ? isCurrent(branch) : void 0, defaultWorktreePath, false),
331
336
  kept
332
337
  };
333
338
  }
@@ -475,7 +480,7 @@ var BranchesGitSubProvider = class {
475
480
  mapperSignal ??= cancellation;
476
481
  const { currentRef, defaultWorktreePath, isDetached } = await this.getCurrentRefAndDefaultWorktreePath(targetRepoPath, commonPath, mapperSignal);
477
482
  const branches = shared.values.map((b) => {
478
- return mapSharedBranch(b, targetRepoPath, commonPath, !b.remote && b.name === currentRef?.name && !isDetached, defaultWorktreePath, true);
483
+ return mapSharedBranch(b, targetRepoPath, commonPath, currentRef != null ? !b.remote && b.name === currentRef.name && !isDetached : void 0, defaultWorktreePath, true);
479
484
  });
480
485
  if (isDetached || currentRef != null && !branches.some((b) => b.current)) {
481
486
  const metadataMap = await this.getBranchMetadataMap(commonPath);