@gitkraken/core-gitlens 0.9.9 → 0.10.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/dist/git/errors.d.ts +7 -0
  3. package/dist/git/errors.js +14 -1
  4. package/dist/git/errors.js.map +1 -1
  5. package/dist/git/providers/status.d.ts +6 -1
  6. package/dist/git/run.types.d.ts +9 -4
  7. package/dist/git-cli/exec/git.js +36 -16
  8. package/dist/git-cli/exec/git.js.map +1 -1
  9. package/dist/git-cli/providers/diff.d.ts +5 -2
  10. package/dist/git-cli/providers/diff.js +21 -9
  11. package/dist/git-cli/providers/diff.js.map +1 -1
  12. package/dist/git-cli/providers/patch.js +5 -7
  13. package/dist/git-cli/providers/patch.js.map +1 -1
  14. package/dist/git-cli/providers/status.d.ts +0 -1
  15. package/dist/git-cli/providers/status.js +119 -142
  16. package/dist/git-cli/providers/status.js.map +1 -1
  17. package/dist/plus/git-github/providers/github/status.d.ts +0 -1
  18. package/dist/plus/git-github/providers/github/status.js.map +1 -1
  19. package/dist/plus/integrations/authentication/cloudIntegrationService.js +24 -7
  20. package/dist/plus/integrations/authentication/cloudIntegrationService.js.map +1 -1
  21. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +7 -0
  22. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +13 -3
  23. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +1 -1
  24. package/dist/plus/integrations/integrationService.js +4 -2
  25. package/dist/plus/integrations/integrationService.js.map +1 -1
  26. package/dist/plus/integrations/models/gitHostIntegration.js +20 -20
  27. package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
  28. package/dist/plus/integrations/models/integration.d.ts +29 -3
  29. package/dist/plus/integrations/models/integration.js +53 -12
  30. package/dist/plus/integrations/models/integration.js.map +1 -1
  31. package/dist/plus/integrations/models/issuesIntegration.js +9 -9
  32. package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
  33. package/dist/plus/integrations/providers/azureDevOps.js +1 -1
  34. package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
  35. package/dist/plus/integrations/providers/azureDevOpsServer.js +1 -1
  36. package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -1
  37. package/dist/plus/integrations/providers/bitbucket-server.js +1 -1
  38. package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -1
  39. package/dist/plus/integrations/providers/bitbucket.js +1 -1
  40. package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
  41. package/dist/plus/integrations/providers/github.js +2 -2
  42. package/dist/plus/integrations/providers/github.js.map +1 -1
  43. package/dist/plus/integrations/providers/gitlab.js +1 -1
  44. package/dist/plus/integrations/providers/gitlab.js.map +1 -1
  45. package/dist/plus/integrations/providers/issueSorts.d.ts +1 -0
  46. package/dist/plus/integrations/reads/drains.d.ts +1 -0
  47. package/dist/utils/cancellation.d.ts +4 -1
  48. package/dist/utils/cancellation.js +4 -2
  49. package/dist/utils/cancellation.js.map +1 -1
  50. package/dist/utils/env/node/exec.d.ts +5 -1
  51. package/dist/utils/env/node/exec.js +8 -5
  52. package/dist/utils/env/node/exec.js.map +1 -1
  53. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,30 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.10.1] - 2026-10-05
10
+
11
+ ### Fixed
12
+
13
+ - Fixes cloud integration operations throwing a JSON parse error when the GitKraken API returns an empty or non-JSON error body, preserving failure notifications, token refresh fallback, and retryable status classification ([#5932](https://github.com/gitkraken/vscode-gitlens/issues/5932)) (plus/integrations)
14
+ - Fixes per-connection reads reporting a connection whose token the GitKraken API could not hand back (a `429` or `5xx` from `v1/provider-tokens`) as a `no-connection` warning, the signal a consumer treats as an expired credential: the read now fails with the token fetch's error, a `rate-limit` warning for a `429` and an `other` warning otherwise. A repository or current-account lookup rejects with that error instead of resolving `undefined`. A terminal answer (`400`, `404`, `410`, `422`) still reads as `no-connection` (plus/integrations)
15
+ - Fixes a forced re-sync (`forceSync` on a read, or a forced `syncCloudConnection`) deleting the stored token before fetching its replacement, which left a connection with no token at all when that fetch failed transiently, so every read until the next good sync reported it gone. The stored token is now replaced only once a new one arrives, and dropped only when the cloud answers definitively that there is none (plus/integrations)
16
+
17
+ ## [0.10.0] - 2026-10-04
18
+
19
+ ### Added
20
+
21
+ - Adds `expectedExitCodes` to `Git.run`'s options: non-zero exit codes that are answers rather than failures, such as `1` from `git diff --quiet`, resolve as `exited` with that code in every `errors` mode, so a read can run with `errors: 'throw'` and still get its answer (git, git-cli)
22
+ - Adds `reason` (`'aborted'`, `'timeout'` or `'unknown'`) to `CancellationError` and `CancelledRunError`, read from how the process ended rather than estimated from its duration, so a consumer can tell a git timeout from a caller abort. A timeout is still a `CancellationError`, and the `reason` on a cancelled `completion` is now exact as well (utils, git, git-cli)
23
+ - Adds `getGitWarning` and `undefinedOnGitWarning` to the git errors module, for a caller that wants the old answer for a read that now rejects: `.catch(undefinedOnGitWarning)` resolves `undefined` when git reported a known warning (a folder that is no longer a repository, a bare repository) and rethrows any other failure, including a cancellation or timeout (git)
24
+
25
+ ### Changed
26
+
27
+ - **Breaking (git, git-cli)** — `status.getStatus`, `getUntrackedFiles`, `getConflictingFiles`, `hasConflictingFiles`, `getWorkingChangesState` and `hasWorkingChanges` reject when git fails, with a `GitError` carrying git's `stderr`, where they used to answer empty or `false`; an empty or `false` answer now always means git ran and found nothing. Cancellation still rejects with `CancellationError`. `hasWorkingChanges`'s `throwOnError` option is removed (it could not surface a git failure anyway), so catch the rejection where a fallback is wanted. `getStatus` rejects where it used to resolve `undefined` (a folder that is no longer a repository, a bare repository), while `getStatusForFile` and `getStatusForPath` still resolve `undefined` there. `diff.getDiffStatus` and `getChangedFilesCount` with `includeUntracked` still leave untracked files out when the listing fails, unless called with `errors: 'throw'`, which now rejects for it too
28
+
29
+ ### Fixed
30
+
31
+ - Fixes `hasWorkingChanges` reporting a repository with no commits as clean when it has staged or modified files: before the first commit it compares against the empty tree (git-cli)
32
+
9
33
  ## [0.9.9] - 2026-10-04
10
34
 
11
35
  ### Changed
@@ -543,7 +567,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
543
567
 
544
568
  - 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.
545
569
 
546
- [unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.9.9...HEAD
570
+ [unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.10.1...HEAD
571
+ [0.10.1]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.10.0...gitkraken:releases/core/v0.10.1
572
+ [0.10.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.9.9...gitkraken:releases/core/v0.10.0
547
573
  [0.9.9]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.9.8...gitkraken:releases/core/v0.9.9
548
574
  [0.9.8]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.9.7...gitkraken:releases/core/v0.9.8
549
575
  [0.9.7]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.9.6...gitkraken:releases/core/v0.9.7
@@ -32,6 +32,13 @@ export declare const GitWarnings: {
32
32
  readonly tipBehind: RegExp;
33
33
  };
34
34
  export type GitWarningKey = keyof typeof GitWarnings;
35
+ /** The {@link GitWarnings} entry a failure's message matches, if any */
36
+ export declare function getGitWarning(ex: unknown): GitWarningKey | undefined;
37
+ /**
38
+ * For a read's `.catch`: answers `undefined` for a {@link GitWarnings} failure (a folder that is no longer a repository,
39
+ * a bare repository) and rethrows any other, including a cancellation or timeout
40
+ */
41
+ export declare function undefinedOnGitWarning(ex: unknown): undefined;
35
42
  export interface GitCommandContext {
36
43
  readonly repoPath: string;
37
44
  readonly args: readonly (string | undefined)[];
@@ -38,6 +38,19 @@ const GitWarnings = {
38
38
  notAGitCommand: /'.+' is not a git command/i,
39
39
  tipBehind: /tip of your current branch is behind/i
40
40
  };
41
+ /** The {@link GitWarnings} entry a failure's message matches, if any */
42
+ function getGitWarning(ex) {
43
+ if (!(ex instanceof Error)) return void 0;
44
+ for (const [key, warning] of Object.entries(GitWarnings)) if (warning.test(ex.message)) return key;
45
+ }
46
+ /**
47
+ * For a read's `.catch`: answers `undefined` for a {@link GitWarnings} failure (a folder that is no longer a repository,
48
+ * a bare repository) and rethrows any other, including a cancellation or timeout
49
+ */
50
+ function undefinedOnGitWarning(ex) {
51
+ if (getGitWarning(ex) != null) return void 0;
52
+ throw ex;
53
+ }
41
54
  var GitCommandError = class GitCommandError extends Error {
42
55
  static is(ex) {
43
56
  return ex instanceof GitCommandError;
@@ -979,6 +992,6 @@ var SigningError = class SigningError extends GitCommandError {
979
992
  }
980
993
  };
981
994
  //#endregion
982
- export { ApplyPatchCommitError, AuthenticationError, AuthenticationErrorReason, BlameIgnoreRevsFileBadRevisionError, BlameIgnoreRevsFileError, BranchError, CheckoutError, CherryPickError, CommitError, FetchError, GitCommandError, GitSearchError, GitWarnings, MergeError, PausedOperationAbortError, PausedOperationContinueError, PullError, PushError, RebaseError, ReferenceUpdateError, RequestClientError, RequestNotFoundError, RequestRateLimitError, ResetError, RevertError, ShowError, SigningError, StashApplyError, StashPushError, TagError, WorkspaceUntrustedError, WorktreeCreateError, WorktreeDeleteError, getDeferredRequestFailure, reportRequestFailure };
995
+ export { ApplyPatchCommitError, AuthenticationError, AuthenticationErrorReason, BlameIgnoreRevsFileBadRevisionError, BlameIgnoreRevsFileError, BranchError, CheckoutError, CherryPickError, CommitError, FetchError, GitCommandError, GitSearchError, GitWarnings, MergeError, PausedOperationAbortError, PausedOperationContinueError, PullError, PushError, RebaseError, ReferenceUpdateError, RequestClientError, RequestNotFoundError, RequestRateLimitError, ResetError, RevertError, ShowError, SigningError, StashApplyError, StashPushError, TagError, WorkspaceUntrustedError, WorktreeCreateError, WorktreeDeleteError, getDeferredRequestFailure, getGitWarning, reportRequestFailure, undefinedOnGitWarning };
983
996
 
984
997
  //# sourceMappingURL=errors.js.map