@gitkraken/core-gitlens 0.1.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 +16 -0
- package/LICENSE +30 -0
- package/LICENSE.plus +40 -0
- package/README.md +54 -0
- package/dist/git/cache.d.ts +140 -0
- package/dist/git/cache.d.ts.map +1 -0
- package/dist/git/cache.js +765 -0
- package/dist/git/cache.js.map +1 -0
- package/dist/git/context.d.ts +238 -0
- package/dist/git/context.d.ts.map +1 -0
- package/dist/git/context.js +11 -0
- package/dist/git/context.js.map +1 -0
- package/dist/git/errors.d.ts +419 -0
- package/dist/git/errors.d.ts.map +1 -0
- package/dist/git/errors.js +681 -0
- package/dist/git/errors.js.map +1 -0
- package/dist/git/exec.types.d.ts +66 -0
- package/dist/git/exec.types.d.ts.map +1 -0
- package/dist/git/exec.types.js +2 -0
- package/dist/git/exec.types.js.map +1 -0
- package/dist/git/features.d.ts +8 -0
- package/dist/git/features.d.ts.map +1 -0
- package/dist/git/features.js +18 -0
- package/dist/git/features.js.map +1 -0
- package/dist/git/models/author.d.ts +17 -0
- package/dist/git/models/author.d.ts.map +1 -0
- package/dist/git/models/author.js +2 -0
- package/dist/git/models/author.js.map +1 -0
- package/dist/git/models/autolink.d.ts +51 -0
- package/dist/git/models/autolink.d.ts.map +1 -0
- package/dist/git/models/autolink.js +2 -0
- package/dist/git/models/autolink.js.map +1 -0
- package/dist/git/models/blame.d.ts +41 -0
- package/dist/git/models/blame.d.ts.map +1 -0
- package/dist/git/models/blame.js +2 -0
- package/dist/git/models/blame.js.map +1 -0
- package/dist/git/models/branch.d.ts +85 -0
- package/dist/git/models/branch.d.ts.map +1 -0
- package/dist/git/models/branch.js +174 -0
- package/dist/git/models/branch.js.map +1 -0
- package/dist/git/models/commit.d.ts +163 -0
- package/dist/git/models/commit.d.ts.map +1 -0
- package/dist/git/models/commit.js +496 -0
- package/dist/git/models/commit.js.map +1 -0
- package/dist/git/models/contributor.d.ts +40 -0
- package/dist/git/models/contributor.d.ts.map +1 -0
- package/dist/git/models/contributor.js +67 -0
- package/dist/git/models/contributor.js.map +1 -0
- package/dist/git/models/defaultBranch.d.ts +6 -0
- package/dist/git/models/defaultBranch.d.ts.map +1 -0
- package/dist/git/models/defaultBranch.js +2 -0
- package/dist/git/models/defaultBranch.js.map +1 -0
- package/dist/git/models/diff.d.ts +73 -0
- package/dist/git/models/diff.d.ts.map +1 -0
- package/dist/git/models/diff.js +2 -0
- package/dist/git/models/diff.js.map +1 -0
- package/dist/git/models/file.d.ts +23 -0
- package/dist/git/models/file.d.ts.map +1 -0
- package/dist/git/models/file.js +2 -0
- package/dist/git/models/file.js.map +1 -0
- package/dist/git/models/fileChange.d.ts +50 -0
- package/dist/git/models/fileChange.d.ts.map +1 -0
- package/dist/git/models/fileChange.js +69 -0
- package/dist/git/models/fileChange.js.map +1 -0
- package/dist/git/models/fileStatus.d.ts +33 -0
- package/dist/git/models/fileStatus.d.ts.map +1 -0
- package/dist/git/models/fileStatus.js +29 -0
- package/dist/git/models/fileStatus.js.map +1 -0
- package/dist/git/models/graph.d.ts +171 -0
- package/dist/git/models/graph.d.ts.map +1 -0
- package/dist/git/models/graph.js +2 -0
- package/dist/git/models/graph.js.map +1 -0
- package/dist/git/models/graphSearch.d.ts +48 -0
- package/dist/git/models/graphSearch.d.ts.map +1 -0
- package/dist/git/models/graphSearch.js +2 -0
- package/dist/git/models/graphSearch.js.map +1 -0
- package/dist/git/models/issue.d.ts +69 -0
- package/dist/git/models/issue.d.ts.map +1 -0
- package/dist/git/models/issue.js +68 -0
- package/dist/git/models/issue.js.map +1 -0
- package/dist/git/models/issueOrPullRequest.d.ts +19 -0
- package/dist/git/models/issueOrPullRequest.d.ts.map +1 -0
- package/dist/git/models/issueOrPullRequest.js +2 -0
- package/dist/git/models/issueOrPullRequest.js.map +1 -0
- package/dist/git/models/lineRange.d.ts +8 -0
- package/dist/git/models/lineRange.d.ts.map +1 -0
- package/dist/git/models/lineRange.js +2 -0
- package/dist/git/models/lineRange.js.map +1 -0
- package/dist/git/models/log.d.ts +19 -0
- package/dist/git/models/log.d.ts.map +1 -0
- package/dist/git/models/log.js +2 -0
- package/dist/git/models/log.js.map +1 -0
- package/dist/git/models/mergeConflicts.d.ts +23 -0
- package/dist/git/models/mergeConflicts.d.ts.map +1 -0
- package/dist/git/models/mergeConflicts.js +2 -0
- package/dist/git/models/mergeConflicts.js.map +1 -0
- package/dist/git/models/patch.d.ts +22 -0
- package/dist/git/models/patch.d.ts.map +1 -0
- package/dist/git/models/patch.js +2 -0
- package/dist/git/models/patch.js.map +1 -0
- package/dist/git/models/pausedOperationStatus.d.ts +52 -0
- package/dist/git/models/pausedOperationStatus.d.ts.map +1 -0
- package/dist/git/models/pausedOperationStatus.js +2 -0
- package/dist/git/models/pausedOperationStatus.js.map +1 -0
- package/dist/git/models/pullRequest.d.ts +125 -0
- package/dist/git/models/pullRequest.d.ts.map +1 -0
- package/dist/git/models/pullRequest.js +127 -0
- package/dist/git/models/pullRequest.js.map +1 -0
- package/dist/git/models/rebase.d.ts +51 -0
- package/dist/git/models/rebase.d.ts.map +1 -0
- package/dist/git/models/rebase.js +2 -0
- package/dist/git/models/rebase.js.map +1 -0
- package/dist/git/models/reference.d.ts +48 -0
- package/dist/git/models/reference.d.ts.map +1 -0
- package/dist/git/models/reference.js +2 -0
- package/dist/git/models/reference.js.map +1 -0
- package/dist/git/models/reflog.d.ts +33 -0
- package/dist/git/models/reflog.d.ts.map +1 -0
- package/dist/git/models/reflog.js +85 -0
- package/dist/git/models/reflog.js.map +1 -0
- package/dist/git/models/remote.d.ts +37 -0
- package/dist/git/models/remote.d.ts.map +1 -0
- package/dist/git/models/remote.js +98 -0
- package/dist/git/models/remote.js.map +1 -0
- package/dist/git/models/remoteProvider.d.ts +112 -0
- package/dist/git/models/remoteProvider.d.ts.map +1 -0
- package/dist/git/models/remoteProvider.js +154 -0
- package/dist/git/models/remoteProvider.js.map +1 -0
- package/dist/git/models/remoteResource.d.ts +78 -0
- package/dist/git/models/remoteResource.d.ts.map +1 -0
- package/dist/git/models/remoteResource.js +13 -0
- package/dist/git/models/remoteResource.js.map +1 -0
- package/dist/git/models/repository.d.ts +106 -0
- package/dist/git/models/repository.d.ts.map +1 -0
- package/dist/git/models/repository.js +324 -0
- package/dist/git/models/repository.js.map +1 -0
- package/dist/git/models/repositoryChangeEvent.d.ts +17 -0
- package/dist/git/models/repositoryChangeEvent.d.ts.map +1 -0
- package/dist/git/models/repositoryChangeEvent.js +26 -0
- package/dist/git/models/repositoryChangeEvent.js.map +1 -0
- package/dist/git/models/repositoryIdentities.d.ts +72 -0
- package/dist/git/models/repositoryIdentities.d.ts.map +1 -0
- package/dist/git/models/repositoryIdentities.js +7 -0
- package/dist/git/models/repositoryIdentities.js.map +1 -0
- package/dist/git/models/repositoryMetadata.d.ts +12 -0
- package/dist/git/models/repositoryMetadata.d.ts.map +1 -0
- package/dist/git/models/repositoryMetadata.js +2 -0
- package/dist/git/models/repositoryMetadata.js.map +1 -0
- package/dist/git/models/resourceDescriptor.d.ts +12 -0
- package/dist/git/models/resourceDescriptor.d.ts.map +1 -0
- package/dist/git/models/resourceDescriptor.js +2 -0
- package/dist/git/models/resourceDescriptor.js.map +1 -0
- package/dist/git/models/revision.d.ts +7 -0
- package/dist/git/models/revision.d.ts.map +1 -0
- package/dist/git/models/revision.js +6 -0
- package/dist/git/models/revision.js.map +1 -0
- package/dist/git/models/search.d.ts +66 -0
- package/dist/git/models/search.d.ts.map +1 -0
- package/dist/git/models/search.js +48 -0
- package/dist/git/models/search.js.map +1 -0
- package/dist/git/models/shortlog.d.ts +6 -0
- package/dist/git/models/shortlog.d.ts.map +1 -0
- package/dist/git/models/shortlog.js +2 -0
- package/dist/git/models/shortlog.js.map +1 -0
- package/dist/git/models/signature.d.ts +26 -0
- package/dist/git/models/signature.d.ts.map +1 -0
- package/dist/git/models/signature.js +2 -0
- package/dist/git/models/signature.js.map +1 -0
- package/dist/git/models/staging.d.ts +24 -0
- package/dist/git/models/staging.d.ts.map +1 -0
- package/dist/git/models/staging.js +2 -0
- package/dist/git/models/staging.js.map +1 -0
- package/dist/git/models/stash.d.ts +6 -0
- package/dist/git/models/stash.d.ts.map +1 -0
- package/dist/git/models/stash.js +2 -0
- package/dist/git/models/stash.js.map +1 -0
- package/dist/git/models/status.d.ts +55 -0
- package/dist/git/models/status.d.ts.map +1 -0
- package/dist/git/models/status.js +208 -0
- package/dist/git/models/status.js.map +1 -0
- package/dist/git/models/statusFile.d.ts +28 -0
- package/dist/git/models/statusFile.d.ts.map +1 -0
- package/dist/git/models/statusFile.js +114 -0
- package/dist/git/models/statusFile.js.map +1 -0
- package/dist/git/models/tag.d.ts +26 -0
- package/dist/git/models/tag.d.ts.map +1 -0
- package/dist/git/models/tag.js +73 -0
- package/dist/git/models/tag.js.map +1 -0
- package/dist/git/models/tree.d.ts +10 -0
- package/dist/git/models/tree.d.ts.map +1 -0
- package/dist/git/models/tree.js +2 -0
- package/dist/git/models/tree.js.map +1 -0
- package/dist/git/models/user.d.ts +7 -0
- package/dist/git/models/user.d.ts.map +1 -0
- package/dist/git/models/user.js +2 -0
- package/dist/git/models/user.js.map +1 -0
- package/dist/git/models/worktree.d.ts +51 -0
- package/dist/git/models/worktree.d.ts.map +1 -0
- package/dist/git/models/worktree.js +136 -0
- package/dist/git/models/worktree.js.map +1 -0
- package/dist/git/parsers/diffParser.d.ts +45 -0
- package/dist/git/parsers/diffParser.d.ts.map +1 -0
- package/dist/git/parsers/diffParser.js +628 -0
- package/dist/git/parsers/diffParser.js.map +1 -0
- package/dist/git/parsers/rebaseTodoParser.d.ts +15 -0
- package/dist/git/parsers/rebaseTodoParser.d.ts.map +1 -0
- package/dist/git/parsers/rebaseTodoParser.js +215 -0
- package/dist/git/parsers/rebaseTodoParser.js.map +1 -0
- package/dist/git/providers/blame.d.ts +15 -0
- package/dist/git/providers/blame.d.ts.map +1 -0
- package/dist/git/providers/blame.js +2 -0
- package/dist/git/providers/blame.js.map +1 -0
- package/dist/git/providers/branches.d.ts +80 -0
- package/dist/git/providers/branches.d.ts.map +1 -0
- package/dist/git/providers/branches.js +2 -0
- package/dist/git/providers/branches.js.map +1 -0
- package/dist/git/providers/commits.d.ts +102 -0
- package/dist/git/providers/commits.d.ts.map +1 -0
- package/dist/git/providers/commits.js +2 -0
- package/dist/git/providers/commits.js.map +1 -0
- package/dist/git/providers/config.d.ts +64 -0
- package/dist/git/providers/config.d.ts.map +1 -0
- package/dist/git/providers/config.js +2 -0
- package/dist/git/providers/config.js.map +1 -0
- package/dist/git/providers/contributors.d.ts +26 -0
- package/dist/git/providers/contributors.d.ts.map +1 -0
- package/dist/git/providers/contributors.js +2 -0
- package/dist/git/providers/contributors.js.map +1 -0
- package/dist/git/providers/diff.d.ts +73 -0
- package/dist/git/providers/diff.d.ts.map +1 -0
- package/dist/git/providers/diff.js +2 -0
- package/dist/git/providers/diff.js.map +1 -0
- package/dist/git/providers/graph.d.ts +20 -0
- package/dist/git/providers/graph.d.ts.map +1 -0
- package/dist/git/providers/graph.js +2 -0
- package/dist/git/providers/graph.js.map +1 -0
- package/dist/git/providers/operations.d.ts +65 -0
- package/dist/git/providers/operations.d.ts.map +1 -0
- package/dist/git/providers/operations.js +2 -0
- package/dist/git/providers/operations.js.map +1 -0
- package/dist/git/providers/patch.d.ts +27 -0
- package/dist/git/providers/patch.d.ts.map +1 -0
- package/dist/git/providers/patch.js +2 -0
- package/dist/git/providers/patch.js.map +1 -0
- package/dist/git/providers/pausedOperations.d.ts +11 -0
- package/dist/git/providers/pausedOperations.d.ts.map +1 -0
- package/dist/git/providers/pausedOperations.js +2 -0
- package/dist/git/providers/pausedOperations.js.map +1 -0
- package/dist/git/providers/provider.d.ts +57 -0
- package/dist/git/providers/provider.d.ts.map +1 -0
- package/dist/git/providers/provider.js +2 -0
- package/dist/git/providers/provider.js.map +1 -0
- package/dist/git/providers/refs.d.ts +22 -0
- package/dist/git/providers/refs.d.ts.map +1 -0
- package/dist/git/providers/refs.js +2 -0
- package/dist/git/providers/refs.js.map +1 -0
- package/dist/git/providers/remotes.d.ts +25 -0
- package/dist/git/providers/remotes.d.ts.map +1 -0
- package/dist/git/providers/remotes.js +2 -0
- package/dist/git/providers/remotes.js.map +1 -0
- package/dist/git/providers/revision.d.ts +28 -0
- package/dist/git/providers/revision.d.ts.map +1 -0
- package/dist/git/providers/revision.js +2 -0
- package/dist/git/providers/revision.js.map +1 -0
- package/dist/git/providers/shared/remotes.d.ts +25 -0
- package/dist/git/providers/shared/remotes.d.ts.map +1 -0
- package/dist/git/providers/shared/remotes.js +79 -0
- package/dist/git/providers/shared/remotes.js.map +1 -0
- package/dist/git/providers/staging.d.ts +22 -0
- package/dist/git/providers/staging.d.ts.map +1 -0
- package/dist/git/providers/staging.js +2 -0
- package/dist/git/providers/staging.js.map +1 -0
- package/dist/git/providers/stash.d.ts +41 -0
- package/dist/git/providers/stash.d.ts.map +1 -0
- package/dist/git/providers/stash.js +2 -0
- package/dist/git/providers/stash.js.map +1 -0
- package/dist/git/providers/status.d.ts +30 -0
- package/dist/git/providers/status.d.ts.map +1 -0
- package/dist/git/providers/status.js +2 -0
- package/dist/git/providers/status.js.map +1 -0
- package/dist/git/providers/tags.d.ts +18 -0
- package/dist/git/providers/tags.d.ts.map +1 -0
- package/dist/git/providers/tags.js +2 -0
- package/dist/git/providers/tags.js.map +1 -0
- package/dist/git/providers/types.d.ts +28 -0
- package/dist/git/providers/types.d.ts.map +1 -0
- package/dist/git/providers/types.js +2 -0
- package/dist/git/providers/types.js.map +1 -0
- package/dist/git/providers/worktrees.d.ts +23 -0
- package/dist/git/providers/worktrees.d.ts.map +1 -0
- package/dist/git/providers/worktrees.js +2 -0
- package/dist/git/providers/worktrees.js.map +1 -0
- package/dist/git/remotes/azure-devops.d.ts +43 -0
- package/dist/git/remotes/azure-devops.d.ts.map +1 -0
- package/dist/git/remotes/azure-devops.js +248 -0
- package/dist/git/remotes/azure-devops.js.map +1 -0
- package/dist/git/remotes/bitbucket-server.d.ts +32 -0
- package/dist/git/remotes/bitbucket-server.d.ts.map +1 -0
- package/dist/git/remotes/bitbucket-server.js +145 -0
- package/dist/git/remotes/bitbucket-server.js.map +1 -0
- package/dist/git/remotes/bitbucket.d.ts +29 -0
- package/dist/git/remotes/bitbucket.d.ts.map +1 -0
- package/dist/git/remotes/bitbucket.js +114 -0
- package/dist/git/remotes/bitbucket.js.map +1 -0
- package/dist/git/remotes/custom.d.ts +26 -0
- package/dist/git/remotes/custom.d.ts.map +1 -0
- package/dist/git/remotes/custom.js +111 -0
- package/dist/git/remotes/custom.js.map +1 -0
- package/dist/git/remotes/gerrit.d.ts +31 -0
- package/dist/git/remotes/gerrit.d.ts.map +1 -0
- package/dist/git/remotes/gerrit.js +146 -0
- package/dist/git/remotes/gerrit.js.map +1 -0
- package/dist/git/remotes/gitea.d.ts +30 -0
- package/dist/git/remotes/gitea.d.ts.map +1 -0
- package/dist/git/remotes/gitea.js +148 -0
- package/dist/git/remotes/gitea.js.map +1 -0
- package/dist/git/remotes/github.d.ts +41 -0
- package/dist/git/remotes/github.d.ts.map +1 -0
- package/dist/git/remotes/github.js +198 -0
- package/dist/git/remotes/github.js.map +1 -0
- package/dist/git/remotes/gitlab.d.ts +35 -0
- package/dist/git/remotes/gitlab.d.ts.map +1 -0
- package/dist/git/remotes/gitlab.js +232 -0
- package/dist/git/remotes/gitlab.js.map +1 -0
- package/dist/git/remotes/google-source.d.ts +17 -0
- package/dist/git/remotes/google-source.d.ts.map +1 -0
- package/dist/git/remotes/google-source.js +32 -0
- package/dist/git/remotes/google-source.js.map +1 -0
- package/dist/git/remotes/matcher.d.ts +35 -0
- package/dist/git/remotes/matcher.d.ts.map +1 -0
- package/dist/git/remotes/matcher.js +140 -0
- package/dist/git/remotes/matcher.js.map +1 -0
- package/dist/git/repositoryService.d.ts +127 -0
- package/dist/git/repositoryService.d.ts.map +1 -0
- package/dist/git/repositoryService.js +54 -0
- package/dist/git/repositoryService.js.map +1 -0
- package/dist/git/service.d.ts +112 -0
- package/dist/git/service.d.ts.map +1 -0
- package/dist/git/service.js +303 -0
- package/dist/git/service.js.map +1 -0
- package/dist/git/utils/autolink.utils.d.ts +13 -0
- package/dist/git/utils/autolink.utils.d.ts.map +1 -0
- package/dist/git/utils/autolink.utils.js +147 -0
- package/dist/git/utils/autolink.utils.js.map +1 -0
- package/dist/git/utils/blame.utils.d.ts +47 -0
- package/dist/git/utils/blame.utils.d.ts.map +1 -0
- package/dist/git/utils/blame.utils.js +239 -0
- package/dist/git/utils/blame.utils.js.map +1 -0
- package/dist/git/utils/branch.utils.d.ts +22 -0
- package/dist/git/utils/branch.utils.d.ts.map +1 -0
- package/dist/git/utils/branch.utils.js +122 -0
- package/dist/git/utils/branch.utils.js.map +1 -0
- package/dist/git/utils/commit.utils.d.ts +26 -0
- package/dist/git/utils/commit.utils.d.ts.map +1 -0
- package/dist/git/utils/commit.utils.js +54 -0
- package/dist/git/utils/commit.utils.js.map +1 -0
- package/dist/git/utils/contributor.utils.d.ts +15 -0
- package/dist/git/utils/contributor.utils.d.ts.map +1 -0
- package/dist/git/utils/contributor.utils.js +55 -0
- package/dist/git/utils/contributor.utils.js.map +1 -0
- package/dist/git/utils/fetch.utils.d.ts +20 -0
- package/dist/git/utils/fetch.utils.d.ts.map +1 -0
- package/dist/git/utils/fetch.utils.js +47 -0
- package/dist/git/utils/fetch.utils.js.map +1 -0
- package/dist/git/utils/fileStatus.utils.d.ts +24 -0
- package/dist/git/utils/fileStatus.utils.d.ts.map +1 -0
- package/dist/git/utils/fileStatus.utils.js +45 -0
- package/dist/git/utils/fileStatus.utils.js.map +1 -0
- package/dist/git/utils/issue.utils.d.ts +4 -0
- package/dist/git/utils/issue.utils.d.ts.map +1 -0
- package/dist/git/utils/issue.utils.js +76 -0
- package/dist/git/utils/issue.utils.js.map +1 -0
- package/dist/git/utils/issueOrPullRequest.utils.d.ts +3 -0
- package/dist/git/utils/issueOrPullRequest.utils.d.ts.map +1 -0
- package/dist/git/utils/issueOrPullRequest.utils.js +22 -0
- package/dist/git/utils/issueOrPullRequest.utils.js.map +1 -0
- package/dist/git/utils/mergeConflicts.utils.d.ts +3 -0
- package/dist/git/utils/mergeConflicts.utils.d.ts.map +1 -0
- package/dist/git/utils/mergeConflicts.utils.js +19 -0
- package/dist/git/utils/mergeConflicts.utils.js.map +1 -0
- package/dist/git/utils/pausedOperationStatus.utils.d.ts +58 -0
- package/dist/git/utils/pausedOperationStatus.utils.d.ts.map +1 -0
- package/dist/git/utils/pausedOperationStatus.utils.js +133 -0
- package/dist/git/utils/pausedOperationStatus.utils.js.map +1 -0
- package/dist/git/utils/pullRequest.utils.d.ts +12 -0
- package/dist/git/utils/pullRequest.utils.d.ts.map +1 -0
- package/dist/git/utils/pullRequest.utils.js +124 -0
- package/dist/git/utils/pullRequest.utils.js.map +1 -0
- package/dist/git/utils/rebase.utils.d.ts +19 -0
- package/dist/git/utils/rebase.utils.d.ts.map +1 -0
- package/dist/git/utils/rebase.utils.js +93 -0
- package/dist/git/utils/rebase.utils.js.map +1 -0
- package/dist/git/utils/reference.utils.d.ts +56 -0
- package/dist/git/utils/reference.utils.d.ts.map +1 -0
- package/dist/git/utils/reference.utils.js +191 -0
- package/dist/git/utils/reference.utils.js.map +1 -0
- package/dist/git/utils/remote.utils.d.ts +17 -0
- package/dist/git/utils/remote.utils.d.ts.map +1 -0
- package/dist/git/utils/remote.utils.js +124 -0
- package/dist/git/utils/remote.utils.js.map +1 -0
- package/dist/git/utils/repository.utils.d.ts +5 -0
- package/dist/git/utils/repository.utils.d.ts.map +1 -0
- package/dist/git/utils/repository.utils.js +15 -0
- package/dist/git/utils/repository.utils.js.map +1 -0
- package/dist/git/utils/resourceDescriptor.utils.d.ts +4 -0
- package/dist/git/utils/resourceDescriptor.utils.d.ts.map +1 -0
- package/dist/git/utils/resourceDescriptor.utils.js +17 -0
- package/dist/git/utils/resourceDescriptor.utils.js.map +1 -0
- package/dist/git/utils/revision.utils.d.ts +36 -0
- package/dist/git/utils/revision.utils.d.ts.map +1 -0
- package/dist/git/utils/revision.utils.js +114 -0
- package/dist/git/utils/revision.utils.js.map +1 -0
- package/dist/git/utils/search.utils.d.ts +15 -0
- package/dist/git/utils/search.utils.d.ts.map +1 -0
- package/dist/git/utils/search.utils.js +422 -0
- package/dist/git/utils/search.utils.js.map +1 -0
- package/dist/git/utils/sorting.d.ts +34 -0
- package/dist/git/utils/sorting.d.ts.map +1 -0
- package/dist/git/utils/sorting.js +203 -0
- package/dist/git/utils/sorting.js.map +1 -0
- package/dist/git/utils/status.utils.d.ts +20 -0
- package/dist/git/utils/status.utils.d.ts.map +1 -0
- package/dist/git/utils/status.utils.js +82 -0
- package/dist/git/utils/status.utils.js.map +1 -0
- package/dist/git/utils/statusFile.utils.d.ts +8 -0
- package/dist/git/utils/statusFile.utils.d.ts.map +1 -0
- package/dist/git/utils/statusFile.utils.js +76 -0
- package/dist/git/utils/statusFile.utils.js.map +1 -0
- package/dist/git/utils/tag.utils.d.ts +7 -0
- package/dist/git/utils/tag.utils.d.ts.map +1 -0
- package/dist/git/utils/tag.utils.js +13 -0
- package/dist/git/utils/tag.utils.js.map +1 -0
- package/dist/git/utils/tooltip.utils.d.ts +14 -0
- package/dist/git/utils/tooltip.utils.d.ts.map +1 -0
- package/dist/git/utils/tooltip.utils.js +29 -0
- package/dist/git/utils/tooltip.utils.js.map +1 -0
- package/dist/git/utils/uriAuthority.d.ts +16 -0
- package/dist/git/utils/uriAuthority.d.ts.map +1 -0
- package/dist/git/utils/uriAuthority.js +20 -0
- package/dist/git/utils/uriAuthority.js.map +1 -0
- package/dist/git/utils/user.utils.d.ts +3 -0
- package/dist/git/utils/user.utils.d.ts.map +1 -0
- package/dist/git/utils/user.utils.js +12 -0
- package/dist/git/utils/user.utils.js.map +1 -0
- package/dist/git/utils/worktree.utils.d.ts +7 -0
- package/dist/git/utils/worktree.utils.d.ts.map +1 -0
- package/dist/git/utils/worktree.utils.js +15 -0
- package/dist/git/utils/worktree.utils.js.map +1 -0
- package/dist/git/watching/changeEvent.d.ts +47 -0
- package/dist/git/watching/changeEvent.d.ts.map +1 -0
- package/dist/git/watching/changeEvent.js +69 -0
- package/dist/git/watching/changeEvent.js.map +1 -0
- package/dist/git/watching/classifyChange.d.ts +16 -0
- package/dist/git/watching/classifyChange.d.ts.map +1 -0
- package/dist/git/watching/classifyChange.js +61 -0
- package/dist/git/watching/classifyChange.js.map +1 -0
- package/dist/git/watching/gitIgnoreFilter.d.ts +58 -0
- package/dist/git/watching/gitIgnoreFilter.d.ts.map +1 -0
- package/dist/git/watching/gitIgnoreFilter.js +109 -0
- package/dist/git/watching/gitIgnoreFilter.js.map +1 -0
- package/dist/git/watching/initWatcher.d.ts +33 -0
- package/dist/git/watching/initWatcher.d.ts.map +1 -0
- package/dist/git/watching/initWatcher.js +59 -0
- package/dist/git/watching/initWatcher.js.map +1 -0
- package/dist/git/watching/provider.d.ts +23 -0
- package/dist/git/watching/provider.d.ts.map +1 -0
- package/dist/git/watching/provider.js +2 -0
- package/dist/git/watching/provider.js.map +1 -0
- package/dist/git/watching/watchGroup.d.ts +54 -0
- package/dist/git/watching/watchGroup.d.ts.map +1 -0
- package/dist/git/watching/watchGroup.js +139 -0
- package/dist/git/watching/watchGroup.js.map +1 -0
- package/dist/git/watching/watchService.d.ts +79 -0
- package/dist/git/watching/watchService.d.ts.map +1 -0
- package/dist/git/watching/watchService.js +282 -0
- package/dist/git/watching/watchService.js.map +1 -0
- package/dist/git/watching/watchSession.d.ts +118 -0
- package/dist/git/watching/watchSession.d.ts.map +1 -0
- package/dist/git/watching/watchSession.js +274 -0
- package/dist/git/watching/watchSession.js.map +1 -0
- package/dist/git/watching/watcherPatterns.d.ts +21 -0
- package/dist/git/watching/watcherPatterns.d.ts.map +1 -0
- package/dist/git/watching/watcherPatterns.js +36 -0
- package/dist/git/watching/watcherPatterns.js.map +1 -0
- package/dist/git-cli/cliGitProvider.d.ts +133 -0
- package/dist/git-cli/cliGitProvider.d.ts.map +1 -0
- package/dist/git-cli/cliGitProvider.js +273 -0
- package/dist/git-cli/cliGitProvider.js.map +1 -0
- package/dist/git-cli/exec/exec.d.ts +4 -0
- package/dist/git-cli/exec/exec.d.ts.map +1 -0
- package/dist/git-cli/exec/exec.errors.d.ts +2 -0
- package/dist/git-cli/exec/exec.errors.d.ts.map +1 -0
- package/dist/git-cli/exec/exec.errors.js +2 -0
- package/dist/git-cli/exec/exec.errors.js.map +1 -0
- package/dist/git-cli/exec/exec.js +3 -0
- package/dist/git-cli/exec/exec.js.map +1 -0
- package/dist/git-cli/exec/exec.types.d.ts +2 -0
- package/dist/git-cli/exec/exec.types.d.ts.map +1 -0
- package/dist/git-cli/exec/exec.types.js +2 -0
- package/dist/git-cli/exec/exec.types.js.map +1 -0
- package/dist/git-cli/exec/features.d.ts +3 -0
- package/dist/git-cli/exec/features.d.ts.map +1 -0
- package/dist/git-cli/exec/features.js +2 -0
- package/dist/git-cli/exec/features.js.map +1 -0
- package/dist/git-cli/exec/git.d.ts +228 -0
- package/dist/git-cli/exec/git.d.ts.map +1 -0
- package/dist/git-cli/exec/git.js +823 -0
- package/dist/git-cli/exec/git.js.map +1 -0
- package/dist/git-cli/exec/gitQueue.d.ts +68 -0
- package/dist/git-cli/exec/gitQueue.d.ts.map +1 -0
- package/dist/git-cli/exec/gitQueue.js +207 -0
- package/dist/git-cli/exec/gitQueue.js.map +1 -0
- package/dist/git-cli/exec/locator.d.ts +14 -0
- package/dist/git-cli/exec/locator.d.ts.map +1 -0
- package/dist/git-cli/exec/locator.js +133 -0
- package/dist/git-cli/exec/locator.js.map +1 -0
- package/dist/git-cli/parsers/blameParser.d.ts +30 -0
- package/dist/git-cli/parsers/blameParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/blameParser.js +339 -0
- package/dist/git-cli/parsers/blameParser.js.map +1 -0
- package/dist/git-cli/parsers/indexParser.d.ts +4 -0
- package/dist/git-cli/parsers/indexParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/indexParser.js +226 -0
- package/dist/git-cli/parsers/indexParser.js.map +1 -0
- package/dist/git-cli/parsers/logParser.d.ts +178 -0
- package/dist/git-cli/parsers/logParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/logParser.js +1166 -0
- package/dist/git-cli/parsers/logParser.js.map +1 -0
- package/dist/git-cli/parsers/mergeTreeParser.d.ts +7 -0
- package/dist/git-cli/parsers/mergeTreeParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/mergeTreeParser.js +74 -0
- package/dist/git-cli/parsers/mergeTreeParser.js.map +1 -0
- package/dist/git-cli/parsers/refParser.d.ts +34 -0
- package/dist/git-cli/parsers/refParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/refParser.js +148 -0
- package/dist/git-cli/parsers/refParser.js.map +1 -0
- package/dist/git-cli/parsers/reflogParser.d.ts +12 -0
- package/dist/git-cli/parsers/reflogParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/reflogParser.js +181 -0
- package/dist/git-cli/parsers/reflogParser.js.map +1 -0
- package/dist/git-cli/parsers/remoteParser.d.ts +4 -0
- package/dist/git-cli/parsers/remoteParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/remoteParser.js +128 -0
- package/dist/git-cli/parsers/remoteParser.js.map +1 -0
- package/dist/git-cli/parsers/shortlogParser.d.ts +4 -0
- package/dist/git-cli/parsers/shortlogParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/shortlogParser.js +51 -0
- package/dist/git-cli/parsers/shortlogParser.js.map +1 -0
- package/dist/git-cli/parsers/signatureParser.d.ts +21 -0
- package/dist/git-cli/parsers/signatureParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/signatureParser.js +139 -0
- package/dist/git-cli/parsers/signatureParser.js.map +1 -0
- package/dist/git-cli/parsers/statusParser.d.ts +4 -0
- package/dist/git-cli/parsers/statusParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/statusParser.js +216 -0
- package/dist/git-cli/parsers/statusParser.js.map +1 -0
- package/dist/git-cli/parsers/treeParser.d.ts +3 -0
- package/dist/git-cli/parsers/treeParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/treeParser.js +110 -0
- package/dist/git-cli/parsers/treeParser.js.map +1 -0
- package/dist/git-cli/parsers/worktreeParser.d.ts +5 -0
- package/dist/git-cli/parsers/worktreeParser.d.ts.map +1 -0
- package/dist/git-cli/parsers/worktreeParser.js +136 -0
- package/dist/git-cli/parsers/worktreeParser.js.map +1 -0
- package/dist/git-cli/providers/blame.d.ts +26 -0
- package/dist/git-cli/providers/blame.d.ts.map +1 -0
- package/dist/git-cli/providers/blame.js +426 -0
- package/dist/git-cli/providers/blame.js.map +1 -0
- package/dist/git-cli/providers/branches.d.ts +87 -0
- package/dist/git-cli/providers/branches.d.ts.map +1 -0
- package/dist/git-cli/providers/branches.js +1153 -0
- package/dist/git-cli/providers/branches.js.map +1 -0
- package/dist/git-cli/providers/commitFilesetUtils.d.ts +4 -0
- package/dist/git-cli/providers/commitFilesetUtils.d.ts.map +1 -0
- package/dist/git-cli/providers/commitFilesetUtils.js +20 -0
- package/dist/git-cli/providers/commitFilesetUtils.js.map +1 -0
- package/dist/git-cli/providers/commits.d.ts +49 -0
- package/dist/git-cli/providers/commits.d.ts.map +1 -0
- package/dist/git-cli/providers/commits.js +1151 -0
- package/dist/git-cli/providers/commits.js.map +1 -0
- package/dist/git-cli/providers/config.d.ts +74 -0
- package/dist/git-cli/providers/config.d.ts.map +1 -0
- package/dist/git-cli/providers/config.js +588 -0
- package/dist/git-cli/providers/config.js.map +1 -0
- package/dist/git-cli/providers/contributors.d.ts +31 -0
- package/dist/git-cli/providers/contributors.d.ts.map +1 -0
- package/dist/git-cli/providers/contributors.js +350 -0
- package/dist/git-cli/providers/contributors.js.map +1 -0
- package/dist/git-cli/providers/diff.d.ts +99 -0
- package/dist/git-cli/providers/diff.d.ts.map +1 -0
- package/dist/git-cli/providers/diff.js +786 -0
- package/dist/git-cli/providers/diff.js.map +1 -0
- package/dist/git-cli/providers/graph.d.ts +31 -0
- package/dist/git-cli/providers/graph.d.ts.map +1 -0
- package/dist/git-cli/providers/graph.js +703 -0
- package/dist/git-cli/providers/graph.js.map +1 -0
- package/dist/git-cli/providers/operations.d.ts +75 -0
- package/dist/git-cli/providers/operations.d.ts.map +1 -0
- package/dist/git-cli/providers/operations.js +564 -0
- package/dist/git-cli/providers/operations.js.map +1 -0
- package/dist/git-cli/providers/patch.d.ts +38 -0
- package/dist/git-cli/providers/patch.d.ts.map +1 -0
- package/dist/git-cli/providers/patch.js +324 -0
- package/dist/git-cli/providers/patch.js.map +1 -0
- package/dist/git-cli/providers/pausedOperations.d.ts +22 -0
- package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -0
- package/dist/git-cli/providers/pausedOperations.js +411 -0
- package/dist/git-cli/providers/pausedOperations.js.map +1 -0
- package/dist/git-cli/providers/refs.d.ts +32 -0
- package/dist/git-cli/providers/refs.d.ts.map +1 -0
- package/dist/git-cli/providers/refs.js +149 -0
- package/dist/git-cli/providers/refs.js.map +1 -0
- package/dist/git-cli/providers/remotes.d.ts +24 -0
- package/dist/git-cli/providers/remotes.d.ts.map +1 -0
- package/dist/git-cli/providers/remotes.js +94 -0
- package/dist/git-cli/providers/remotes.js.map +1 -0
- package/dist/git-cli/providers/revision.d.ts +27 -0
- package/dist/git-cli/providers/revision.d.ts.map +1 -0
- package/dist/git-cli/providers/revision.js +269 -0
- package/dist/git-cli/providers/revision.js.map +1 -0
- package/dist/git-cli/providers/staging.d.ts +24 -0
- package/dist/git-cli/providers/staging.d.ts.map +1 -0
- package/dist/git-cli/providers/staging.js +138 -0
- package/dist/git-cli/providers/staging.js.map +1 -0
- package/dist/git-cli/providers/stash.d.ts +55 -0
- package/dist/git-cli/providers/stash.d.ts.map +1 -0
- package/dist/git-cli/providers/stash.js +430 -0
- package/dist/git-cli/providers/stash.js.map +1 -0
- package/dist/git-cli/providers/status.d.ts +38 -0
- package/dist/git-cli/providers/status.d.ts.map +1 -0
- package/dist/git-cli/providers/status.js +352 -0
- package/dist/git-cli/providers/status.js.map +1 -0
- package/dist/git-cli/providers/tags.d.ts +29 -0
- package/dist/git-cli/providers/tags.d.ts.map +1 -0
- package/dist/git-cli/providers/tags.js +190 -0
- package/dist/git-cli/providers/tags.js.map +1 -0
- package/dist/git-cli/providers/worktrees.d.ts +33 -0
- package/dist/git-cli/providers/worktrees.d.ts.map +1 -0
- package/dist/git-cli/providers/worktrees.js +175 -0
- package/dist/git-cli/providers/worktrees.js.map +1 -0
- package/dist/git-cli/service.d.ts +52 -0
- package/dist/git-cli/service.d.ts.map +1 -0
- package/dist/git-cli/service.js +35 -0
- package/dist/git-cli/service.js.map +1 -0
- package/dist/plus/ai/constants.d.ts +21 -0
- package/dist/plus/ai/constants.d.ts.map +1 -0
- package/dist/plus/ai/constants.js +99 -0
- package/dist/plus/ai/constants.js.map +1 -0
- package/dist/plus/ai/errors.d.ts +25 -0
- package/dist/plus/ai/errors.d.ts.map +1 -0
- package/dist/plus/ai/errors.js +76 -0
- package/dist/plus/ai/errors.js.map +1 -0
- package/dist/plus/ai/models/conversation.d.ts +12 -0
- package/dist/plus/ai/models/conversation.d.ts.map +1 -0
- package/dist/plus/ai/models/conversation.js +27 -0
- package/dist/plus/ai/models/conversation.js.map +1 -0
- package/dist/plus/ai/models/model.d.ts +34 -0
- package/dist/plus/ai/models/model.d.ts.map +1 -0
- package/dist/plus/ai/models/model.js +379 -0
- package/dist/plus/ai/models/model.js.map +1 -0
- package/dist/plus/ai/models/promptTemplates.d.ts +74 -0
- package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -0
- package/dist/plus/ai/models/promptTemplates.js +2 -0
- package/dist/plus/ai/models/promptTemplates.js.map +1 -0
- package/dist/plus/ai/models/provider.d.ts +46 -0
- package/dist/plus/ai/models/provider.d.ts.map +1 -0
- package/dist/plus/ai/models/provider.js +2 -0
- package/dist/plus/ai/models/provider.js.map +1 -0
- package/dist/plus/ai/models/results.d.ts +5 -0
- package/dist/plus/ai/models/results.d.ts.map +1 -0
- package/dist/plus/ai/models/results.js +2 -0
- package/dist/plus/ai/models/results.js.map +1 -0
- package/dist/plus/ai/prompts.d.ts +13 -0
- package/dist/plus/ai/prompts.d.ts.map +1 -0
- package/dist/plus/ai/prompts.js +517 -0
- package/dist/plus/ai/prompts.js.map +1 -0
- package/dist/plus/ai/providers/anthropicProvider.d.ts +21 -0
- package/dist/plus/ai/providers/anthropicProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/anthropicProvider.js +257 -0
- package/dist/plus/ai/providers/anthropicProvider.js.map +1 -0
- package/dist/plus/ai/providers/azureProvider.d.ts +18 -0
- package/dist/plus/ai/providers/azureProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/azureProvider.js +54 -0
- package/dist/plus/ai/providers/azureProvider.js.map +1 -0
- package/dist/plus/ai/providers/context.d.ts +23 -0
- package/dist/plus/ai/providers/context.d.ts.map +1 -0
- package/dist/plus/ai/providers/context.js +2 -0
- package/dist/plus/ai/providers/context.js.map +1 -0
- package/dist/plus/ai/providers/deepSeekProvider.d.ts +15 -0
- package/dist/plus/ai/providers/deepSeekProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/deepSeekProvider.js +35 -0
- package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -0
- package/dist/plus/ai/providers/geminiProvider.d.ts +15 -0
- package/dist/plus/ai/providers/geminiProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/geminiProvider.js +195 -0
- package/dist/plus/ai/providers/geminiProvider.js.map +1 -0
- package/dist/plus/ai/providers/githubModelsProvider.d.ts +19 -0
- package/dist/plus/ai/providers/githubModelsProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/githubModelsProvider.js +51 -0
- package/dist/plus/ai/providers/githubModelsProvider.js.map +1 -0
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts +18 -0
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/gitkrakenProvider.js +151 -0
- package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -0
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts +15 -0
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/huggingFaceProvider.js +39 -0
- package/dist/plus/ai/providers/huggingFaceProvider.js.map +1 -0
- package/dist/plus/ai/providers/mistralProvider.d.ts +20 -0
- package/dist/plus/ai/providers/mistralProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/mistralProvider.js +118 -0
- package/dist/plus/ai/providers/mistralProvider.js.map +1 -0
- package/dist/plus/ai/providers/ollamaProvider.d.ts +25 -0
- package/dist/plus/ai/providers/ollamaProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/ollamaProvider.js +155 -0
- package/dist/plus/ai/providers/ollamaProvider.js.map +1 -0
- package/dist/plus/ai/providers/openAICompatibleProvider.d.ts +17 -0
- package/dist/plus/ai/providers/openAICompatibleProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/openAICompatibleProvider.js +47 -0
- package/dist/plus/ai/providers/openAICompatibleProvider.js.map +1 -0
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +39 -0
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +1 -0
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js +218 -0
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -0
- package/dist/plus/ai/providers/openRouterProvider.d.ts +17 -0
- package/dist/plus/ai/providers/openRouterProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/openRouterProvider.js +57 -0
- package/dist/plus/ai/providers/openRouterProvider.js.map +1 -0
- package/dist/plus/ai/providers/openaiProvider.d.ts +16 -0
- package/dist/plus/ai/providers/openaiProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/openaiProvider.js +34 -0
- package/dist/plus/ai/providers/openaiProvider.js.map +1 -0
- package/dist/plus/ai/providers/xaiProvider.d.ts +15 -0
- package/dist/plus/ai/providers/xaiProvider.d.ts.map +1 -0
- package/dist/plus/ai/providers/xaiProvider.js +27 -0
- package/dist/plus/ai/providers/xaiProvider.js.map +1 -0
- package/dist/plus/ai/utils/ai.utils.d.ts +18 -0
- package/dist/plus/ai/utils/ai.utils.d.ts.map +1 -0
- package/dist/plus/ai/utils/ai.utils.js +70 -0
- package/dist/plus/ai/utils/ai.utils.js.map +1 -0
- package/dist/plus/ai/utils/results.utils.d.ts +9 -0
- package/dist/plus/ai/utils/results.utils.d.ts.map +1 -0
- package/dist/plus/ai/utils/results.utils.js +44 -0
- package/dist/plus/ai/utils/results.utils.js.map +1 -0
- package/dist/plus/ai/utils/truncation.utils.d.ts +13 -0
- package/dist/plus/ai/utils/truncation.utils.d.ts.map +1 -0
- package/dist/plus/ai/utils/truncation.utils.js +228 -0
- package/dist/plus/ai/utils/truncation.utils.js.map +1 -0
- package/dist/plus/git-github/api/config.d.ts +66 -0
- package/dist/plus/git-github/api/config.d.ts.map +1 -0
- package/dist/plus/git-github/api/config.js +2 -0
- package/dist/plus/git-github/api/config.js.map +1 -0
- package/dist/plus/git-github/api/github.d.ts +178 -0
- package/dist/plus/git-github/api/github.d.ts.map +1 -0
- package/dist/plus/git-github/api/github.js +2360 -0
- package/dist/plus/git-github/api/github.js.map +1 -0
- package/dist/plus/git-github/api/github.utils.d.ts +9 -0
- package/dist/plus/git-github/api/github.utils.d.ts.map +1 -0
- package/dist/plus/git-github/api/github.utils.js +22 -0
- package/dist/plus/git-github/api/github.utils.js.map +1 -0
- package/dist/plus/git-github/api/token.d.ts +16 -0
- package/dist/plus/git-github/api/token.d.ts.map +1 -0
- package/dist/plus/git-github/api/token.js +2 -0
- package/dist/plus/git-github/api/token.js.map +1 -0
- package/dist/plus/git-github/api/tokenUtils.d.ts +7 -0
- package/dist/plus/git-github/api/tokenUtils.d.ts.map +1 -0
- package/dist/plus/git-github/api/tokenUtils.js +13 -0
- package/dist/plus/git-github/api/tokenUtils.js.map +1 -0
- package/dist/plus/git-github/api/types.d.ts +100 -0
- package/dist/plus/git-github/api/types.d.ts.map +1 -0
- package/dist/plus/git-github/api/types.js +2 -0
- package/dist/plus/git-github/api/types.js.map +1 -0
- package/dist/plus/git-github/context.d.ts +102 -0
- package/dist/plus/git-github/context.d.ts.map +1 -0
- package/dist/plus/git-github/context.js +12 -0
- package/dist/plus/git-github/context.js.map +1 -0
- package/dist/plus/git-github/models.d.ts +204 -0
- package/dist/plus/git-github/models.d.ts.map +1 -0
- package/dist/plus/git-github/models.js +229 -0
- package/dist/plus/git-github/models.js.map +1 -0
- package/dist/plus/git-github/providers/github/blame.d.ts +34 -0
- package/dist/plus/git-github/providers/github/blame.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/blame.js +155 -0
- package/dist/plus/git-github/providers/github/blame.js.map +1 -0
- package/dist/plus/git-github/providers/github/branches.d.ts +38 -0
- package/dist/plus/git-github/providers/github/branches.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/branches.js +234 -0
- package/dist/plus/git-github/providers/github/branches.js.map +1 -0
- package/dist/plus/git-github/providers/github/commits.d.ts +36 -0
- package/dist/plus/git-github/providers/github/commits.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/commits.js +560 -0
- package/dist/plus/git-github/providers/github/commits.js.map +1 -0
- package/dist/plus/git-github/providers/github/config.d.ts +11 -0
- package/dist/plus/git-github/providers/github/config.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/config.js +47 -0
- package/dist/plus/git-github/providers/github/config.js.map +1 -0
- package/dist/plus/git-github/providers/github/contributors.d.ts +27 -0
- package/dist/plus/git-github/providers/github/contributors.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/contributors.js +218 -0
- package/dist/plus/git-github/providers/github/contributors.js.map +1 -0
- package/dist/plus/git-github/providers/github/diff.d.ts +33 -0
- package/dist/plus/git-github/providers/github/diff.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/diff.js +184 -0
- package/dist/plus/git-github/providers/github/diff.js.map +1 -0
- package/dist/plus/git-github/providers/github/graph.d.ts +25 -0
- package/dist/plus/git-github/providers/github/graph.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/graph.js +372 -0
- package/dist/plus/git-github/providers/github/graph.js.map +1 -0
- package/dist/plus/git-github/providers/github/refs.d.ts +26 -0
- package/dist/plus/git-github/providers/github/refs.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/refs.js +108 -0
- package/dist/plus/git-github/providers/github/refs.js.map +1 -0
- package/dist/plus/git-github/providers/github/remotes.d.ts +9 -0
- package/dist/plus/git-github/providers/github/remotes.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/remotes.js +37 -0
- package/dist/plus/git-github/providers/github/remotes.js.map +1 -0
- package/dist/plus/git-github/providers/github/revision.d.ts +14 -0
- package/dist/plus/git-github/providers/github/revision.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/revision.js +132 -0
- package/dist/plus/git-github/providers/github/revision.js.map +1 -0
- package/dist/plus/git-github/providers/github/status.d.ts +21 -0
- package/dist/plus/git-github/providers/github/status.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/status.js +49 -0
- package/dist/plus/git-github/providers/github/status.js.map +1 -0
- package/dist/plus/git-github/providers/github/tags.d.ts +22 -0
- package/dist/plus/git-github/providers/github/tags.d.ts.map +1 -0
- package/dist/plus/git-github/providers/github/tags.js +104 -0
- package/dist/plus/git-github/providers/github/tags.js.map +1 -0
- package/dist/plus/git-github/providers/githubGitProvider.d.ts +85 -0
- package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +1 -0
- package/dist/plus/git-github/providers/githubGitProvider.js +130 -0
- package/dist/plus/git-github/providers/githubGitProvider.js.map +1 -0
- package/dist/plus/git-github/providers/githubProvider.d.ts +55 -0
- package/dist/plus/git-github/providers/githubProvider.d.ts.map +1 -0
- package/dist/plus/git-github/providers/githubProvider.js +2 -0
- package/dist/plus/git-github/providers/githubProvider.js.map +1 -0
- package/dist/utils/array.d.ts +27 -0
- package/dist/utils/array.d.ts.map +1 -0
- package/dist/utils/array.js +142 -0
- package/dist/utils/array.js.map +1 -0
- package/dist/utils/base64.d.ts +2 -0
- package/dist/utils/base64.d.ts.map +1 -0
- package/dist/utils/base64.js +2 -0
- package/dist/utils/base64.js.map +1 -0
- package/dist/utils/brand.d.ts +11 -0
- package/dist/utils/brand.d.ts.map +1 -0
- package/dist/utils/brand.js +2 -0
- package/dist/utils/brand.js.map +1 -0
- package/dist/utils/cancellation.d.ts +54 -0
- package/dist/utils/cancellation.d.ts.map +1 -0
- package/dist/utils/cancellation.js +133 -0
- package/dist/utils/cancellation.js.map +1 -0
- package/dist/utils/charCode.d.ts +39 -0
- package/dist/utils/charCode.d.ts.map +1 -0
- package/dist/utils/charCode.js +39 -0
- package/dist/utils/charCode.js.map +1 -0
- package/dist/utils/color.d.ts +177 -0
- package/dist/utils/color.d.ts.map +1 -0
- package/dist/utils/color.js +693 -0
- package/dist/utils/color.js.map +1 -0
- package/dist/utils/counter.d.ts +7 -0
- package/dist/utils/counter.d.ts.map +1 -0
- package/dist/utils/counter.js +19 -0
- package/dist/utils/counter.js.map +1 -0
- package/dist/utils/crypto.d.ts +2 -0
- package/dist/utils/crypto.d.ts.map +1 -0
- package/dist/utils/crypto.js +2 -0
- package/dist/utils/crypto.js.map +1 -0
- package/dist/utils/date.d.ts +20 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/date.js +313 -0
- package/dist/utils/date.js.map +1 -0
- package/dist/utils/debounce.d.ts +108 -0
- package/dist/utils/debounce.d.ts.map +1 -0
- package/dist/utils/debounce.js +209 -0
- package/dist/utils/debounce.js.map +1 -0
- package/dist/utils/decorators/debounce.d.ts +3 -0
- package/dist/utils/decorators/debounce.d.ts.map +1 -0
- package/dist/utils/decorators/debounce.js +21 -0
- package/dist/utils/decorators/debounce.js.map +1 -0
- package/dist/utils/decorators/gate.d.ts +15 -0
- package/dist/utils/decorators/gate.d.ts.map +1 -0
- package/dist/utils/decorators/gate.js +129 -0
- package/dist/utils/decorators/gate.js.map +1 -0
- package/dist/utils/decorators/log.d.ts +46 -0
- package/dist/utils/decorators/log.d.ts.map +1 -0
- package/dist/utils/decorators/log.js +238 -0
- package/dist/utils/decorators/log.js.map +1 -0
- package/dist/utils/decorators/memoize.d.ts +17 -0
- package/dist/utils/decorators/memoize.d.ts.map +1 -0
- package/dist/utils/decorators/memoize.js +63 -0
- package/dist/utils/decorators/memoize.js.map +1 -0
- package/dist/utils/decorators/resolver.d.ts +12 -0
- package/dist/utils/decorators/resolver.d.ts.map +1 -0
- package/dist/utils/decorators/resolver.js +85 -0
- package/dist/utils/decorators/resolver.js.map +1 -0
- package/dist/utils/decorators/sequentialize.d.ts +29 -0
- package/dist/utils/decorators/sequentialize.d.ts.map +1 -0
- package/dist/utils/decorators/sequentialize.js +81 -0
- package/dist/utils/decorators/sequentialize.js.map +1 -0
- package/dist/utils/decorators/serializable.d.ts +13 -0
- package/dist/utils/decorators/serializable.d.ts.map +1 -0
- package/dist/utils/decorators/serializable.js +42 -0
- package/dist/utils/decorators/serializable.js.map +1 -0
- package/dist/utils/disposable.d.ts +40 -0
- package/dist/utils/disposable.d.ts.map +1 -0
- package/dist/utils/disposable.js +87 -0
- package/dist/utils/disposable.js.map +1 -0
- package/dist/utils/encoding.d.ts +3 -0
- package/dist/utils/encoding.d.ts.map +1 -0
- package/dist/utils/encoding.js +7 -0
- package/dist/utils/encoding.js.map +1 -0
- package/dist/utils/env/browser/base64.d.ts +9 -0
- package/dist/utils/env/browser/base64.d.ts.map +1 -0
- package/dist/utils/env/browser/base64.js +42 -0
- package/dist/utils/env/browser/base64.js.map +1 -0
- package/dist/utils/env/browser/crypto.d.ts +5 -0
- package/dist/utils/env/browser/crypto.d.ts.map +1 -0
- package/dist/utils/env/browser/crypto.js +18 -0
- package/dist/utils/env/browser/crypto.js.map +1 -0
- package/dist/utils/env/browser/fs.d.ts +2 -0
- package/dist/utils/env/browser/fs.d.ts.map +1 -0
- package/dist/utils/env/browser/fs.js +4 -0
- package/dist/utils/env/browser/fs.js.map +1 -0
- package/dist/utils/env/browser/hex.d.ts +4 -0
- package/dist/utils/env/browser/hex.d.ts.map +1 -0
- package/dist/utils/env/browser/hex.js +38 -0
- package/dist/utils/env/browser/hex.js.map +1 -0
- package/dist/utils/env/browser/hrtime.d.ts +2 -0
- package/dist/utils/env/browser/hrtime.d.ts.map +1 -0
- package/dist/utils/env/browser/hrtime.js +15 -0
- package/dist/utils/env/browser/hrtime.js.map +1 -0
- package/dist/utils/env/browser/logScope.d.ts +25 -0
- package/dist/utils/env/browser/logScope.d.ts.map +1 -0
- package/dist/utils/env/browser/logScope.js +53 -0
- package/dist/utils/env/browser/logScope.js.map +1 -0
- package/dist/utils/env/browser/md5.d.ts +2 -0
- package/dist/utils/env/browser/md5.d.ts.map +1 -0
- package/dist/utils/env/browser/md5.js +199 -0
- package/dist/utils/env/browser/md5.js.map +1 -0
- package/dist/utils/env/browser/platform.d.ts +4 -0
- package/dist/utils/env/browser/platform.d.ts.map +1 -0
- package/dist/utils/env/browser/platform.js +6 -0
- package/dist/utils/env/browser/platform.js.map +1 -0
- package/dist/utils/env/node/base64.d.ts +9 -0
- package/dist/utils/env/node/base64.d.ts.map +1 -0
- package/dist/utils/env/node/base64.js +14 -0
- package/dist/utils/env/node/base64.js.map +1 -0
- package/dist/utils/env/node/crypto.d.ts +5 -0
- package/dist/utils/env/node/crypto.d.ts.map +1 -0
- package/dist/utils/env/node/crypto.js +14 -0
- package/dist/utils/env/node/crypto.js.map +1 -0
- package/dist/utils/env/node/exec.d.ts +89 -0
- package/dist/utils/env/node/exec.d.ts.map +1 -0
- package/dist/utils/env/node/exec.js +277 -0
- package/dist/utils/env/node/exec.js.map +1 -0
- package/dist/utils/env/node/fs.d.ts +2 -0
- package/dist/utils/env/node/fs.d.ts.map +1 -0
- package/dist/utils/env/node/fs.js +5 -0
- package/dist/utils/env/node/fs.js.map +1 -0
- package/dist/utils/env/node/hex.d.ts +4 -0
- package/dist/utils/env/node/hex.d.ts.map +1 -0
- package/dist/utils/env/node/hex.js +10 -0
- package/dist/utils/env/node/hex.js.map +1 -0
- package/dist/utils/env/node/hrtime.d.ts +2 -0
- package/dist/utils/env/node/hrtime.d.ts.map +1 -0
- package/dist/utils/env/node/hrtime.js +2 -0
- package/dist/utils/env/node/hrtime.js.map +1 -0
- package/dist/utils/env/node/logScope.d.ts +34 -0
- package/dist/utils/env/node/logScope.d.ts.map +1 -0
- package/dist/utils/env/node/logScope.js +52 -0
- package/dist/utils/env/node/logScope.js.map +1 -0
- package/dist/utils/env/node/platform.d.ts +4 -0
- package/dist/utils/env/node/platform.d.ts.map +1 -0
- package/dist/utils/env/node/platform.js +5 -0
- package/dist/utils/env/node/platform.js.map +1 -0
- package/dist/utils/error.d.ts +18 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +19 -0
- package/dist/utils/error.js.map +1 -0
- package/dist/utils/event.d.ts +59 -0
- package/dist/utils/event.d.ts.map +1 -0
- package/dist/utils/event.js +183 -0
- package/dist/utils/event.js.map +1 -0
- package/dist/utils/formatter.d.ts +21 -0
- package/dist/utils/formatter.d.ts.map +1 -0
- package/dist/utils/formatter.js +139 -0
- package/dist/utils/formatter.js.map +1 -0
- package/dist/utils/fs.d.ts +2 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +2 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/function.d.ts +24 -0
- package/dist/utils/function.d.ts.map +1 -0
- package/dist/utils/function.js +103 -0
- package/dist/utils/function.js.map +1 -0
- package/dist/utils/fuzzy.d.ts +68 -0
- package/dist/utils/fuzzy.d.ts.map +1 -0
- package/dist/utils/fuzzy.js +134 -0
- package/dist/utils/fuzzy.js.map +1 -0
- package/dist/utils/hash.d.ts +32 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +53 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/hex.d.ts +2 -0
- package/dist/utils/hex.d.ts.map +1 -0
- package/dist/utils/hex.js +2 -0
- package/dist/utils/hex.js.map +1 -0
- package/dist/utils/hrtime.d.ts +4 -0
- package/dist/utils/hrtime.d.ts.map +1 -0
- package/dist/utils/hrtime.js +7 -0
- package/dist/utils/hrtime.js.map +1 -0
- package/dist/utils/iterable.d.ts +65 -0
- package/dist/utils/iterable.d.ts.map +1 -0
- package/dist/utils/iterable.js +635 -0
- package/dist/utils/iterable.js.map +1 -0
- package/dist/utils/lazy.d.ts +18 -0
- package/dist/utils/lazy.d.ts.map +1 -0
- package/dist/utils/lazy.js +40 -0
- package/dist/utils/lazy.js.map +1 -0
- package/dist/utils/loggable.d.ts +5 -0
- package/dist/utils/loggable.d.ts.map +1 -0
- package/dist/utils/loggable.js +4 -0
- package/dist/utils/loggable.js.map +1 -0
- package/dist/utils/logger.d.ts +63 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +316 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/logger.scoped.d.ts +56 -0
- package/dist/utils/logger.scoped.d.ts.map +1 -0
- package/dist/utils/logger.scoped.js +166 -0
- package/dist/utils/logger.scoped.js.map +1 -0
- package/dist/utils/markdown.d.ts +9 -0
- package/dist/utils/markdown.d.ts.map +1 -0
- package/dist/utils/markdown.js +100 -0
- package/dist/utils/markdown.js.map +1 -0
- package/dist/utils/mru.d.ts +14 -0
- package/dist/utils/mru.d.ts.map +1 -0
- package/dist/utils/mru.js +63 -0
- package/dist/utils/mru.js.map +1 -0
- package/dist/utils/object.d.ts +62 -0
- package/dist/utils/object.d.ts.map +1 -0
- package/dist/utils/object.js +151 -0
- package/dist/utils/object.js.map +1 -0
- package/dist/utils/paging.d.ts +19 -0
- package/dist/utils/paging.d.ts.map +1 -0
- package/dist/utils/paging.js +32 -0
- package/dist/utils/paging.js.map +1 -0
- package/dist/utils/path.d.ts +17 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/path.js +156 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/platform.d.ts +2 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +2 -0
- package/dist/utils/platform.js.map +1 -0
- package/dist/utils/promise.d.ts +61 -0
- package/dist/utils/promise.d.ts.map +1 -0
- package/dist/utils/promise.js +337 -0
- package/dist/utils/promise.js.map +1 -0
- package/dist/utils/promiseCache.d.ts +337 -0
- package/dist/utils/promiseCache.d.ts.map +1 -0
- package/dist/utils/promiseCache.js +634 -0
- package/dist/utils/promiseCache.js.map +1 -0
- package/dist/utils/searchTree.d.ts +58 -0
- package/dist/utils/searchTree.d.ts.map +1 -0
- package/dist/utils/searchTree.js +394 -0
- package/dist/utils/searchTree.js.map +1 -0
- package/dist/utils/stopwatch.d.ts +41 -0
- package/dist/utils/stopwatch.d.ts.map +1 -0
- package/dist/utils/stopwatch.js +83 -0
- package/dist/utils/stopwatch.js.map +1 -0
- package/dist/utils/string.d.ts +91 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/string.js +803 -0
- package/dist/utils/string.js.map +1 -0
- package/dist/utils/subscriptionManager.d.ts +18 -0
- package/dist/utils/subscriptionManager.d.ts.map +1 -0
- package/dist/utils/subscriptionManager.js +34 -0
- package/dist/utils/subscriptionManager.js.map +1 -0
- package/dist/utils/trie.d.ts +76 -0
- package/dist/utils/trie.d.ts.map +1 -0
- package/dist/utils/trie.js +584 -0
- package/dist/utils/trie.js.map +1 -0
- package/dist/utils/types.d.ts +21 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +2 -0
- package/dist/utils/types.js.map +1 -0
- package/dist/utils/uri.d.ts +69 -0
- package/dist/utils/uri.d.ts.map +1 -0
- package/dist/utils/uri.js +66 -0
- package/dist/utils/uri.js.map +1 -0
- package/dist/utils/validation.d.ts +14 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +26 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/utils/version.d.ts +15 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +66 -0
- package/dist/utils/version.js.map +1 -0
- package/package.json +161 -0
- package/src/git/cache.ts +1152 -0
- package/src/git/context.ts +248 -0
- package/src/git/errors.ts +1121 -0
- package/src/git/exec.types.ts +78 -0
- package/src/git/features.ts +45 -0
- package/src/git/models/author.ts +19 -0
- package/src/git/models/autolink.ts +59 -0
- package/src/git/models/blame.ts +46 -0
- package/src/git/models/branch.ts +236 -0
- package/src/git/models/commit.ts +688 -0
- package/src/git/models/contributor.ts +84 -0
- package/src/git/models/defaultBranch.ts +6 -0
- package/src/git/models/diff.ts +74 -0
- package/src/git/models/file.ts +29 -0
- package/src/git/models/fileChange.ts +82 -0
- package/src/git/models/fileStatus.ts +35 -0
- package/src/git/models/graph.ts +184 -0
- package/src/git/models/graphSearch.ts +53 -0
- package/src/git/models/issue.ts +88 -0
- package/src/git/models/issueOrPullRequest.ts +20 -0
- package/src/git/models/lineRange.ts +7 -0
- package/src/git/models/log.ts +21 -0
- package/src/git/models/mergeConflicts.ts +18 -0
- package/src/git/models/patch.ts +25 -0
- package/src/git/models/pausedOperationStatus.ts +63 -0
- package/src/git/models/pullRequest.ts +161 -0
- package/src/git/models/rebase.ts +60 -0
- package/src/git/models/reference.ts +47 -0
- package/src/git/models/reflog.ts +88 -0
- package/src/git/models/remote.ts +99 -0
- package/src/git/models/remoteProvider.ts +290 -0
- package/src/git/models/remoteResource.ts +87 -0
- package/src/git/models/repository.ts +417 -0
- package/src/git/models/repositoryChangeEvent.ts +30 -0
- package/src/git/models/repositoryIdentities.ts +99 -0
- package/src/git/models/repositoryMetadata.ts +12 -0
- package/src/git/models/resourceDescriptor.ts +11 -0
- package/src/git/models/revision.ts +12 -0
- package/src/git/models/search.ts +123 -0
- package/src/git/models/shortlog.ts +6 -0
- package/src/git/models/signature.ts +29 -0
- package/src/git/models/staging.ts +27 -0
- package/src/git/models/stash.ts +6 -0
- package/src/git/models/status.ts +246 -0
- package/src/git/models/statusFile.ts +116 -0
- package/src/git/models/tag.ts +71 -0
- package/src/git/models/tree.ts +10 -0
- package/src/git/models/user.ts +7 -0
- package/src/git/models/worktree.ts +152 -0
- package/src/git/parsers/diffParser.ts +660 -0
- package/src/git/parsers/rebaseTodoParser.ts +169 -0
- package/src/git/providers/blame.ts +40 -0
- package/src/git/providers/branches.ts +111 -0
- package/src/git/providers/commits.ts +147 -0
- package/src/git/providers/config.ts +104 -0
- package/src/git/providers/contributors.ts +34 -0
- package/src/git/providers/diff.ts +127 -0
- package/src/git/providers/graph.ts +30 -0
- package/src/git/providers/operations.ts +82 -0
- package/src/git/providers/patch.ts +31 -0
- package/src/git/providers/pausedOperations.ts +10 -0
- package/src/git/providers/provider.ts +62 -0
- package/src/git/providers/refs.ts +39 -0
- package/src/git/providers/remotes.ts +33 -0
- package/src/git/providers/revision.ts +28 -0
- package/src/git/providers/shared/remotes.ts +95 -0
- package/src/git/providers/staging.ts +22 -0
- package/src/git/providers/stash.ts +51 -0
- package/src/git/providers/status.ts +42 -0
- package/src/git/providers/tags.ts +28 -0
- package/src/git/providers/types.ts +33 -0
- package/src/git/providers/worktrees.ts +23 -0
- package/src/git/remotes/azure-devops.ts +309 -0
- package/src/git/remotes/bitbucket-server.ts +191 -0
- package/src/git/remotes/bitbucket.ts +144 -0
- package/src/git/remotes/custom.ts +139 -0
- package/src/git/remotes/gerrit.ts +188 -0
- package/src/git/remotes/gitea.ts +186 -0
- package/src/git/remotes/github.ts +238 -0
- package/src/git/remotes/gitlab.ts +272 -0
- package/src/git/remotes/google-source.ts +51 -0
- package/src/git/remotes/matcher.ts +215 -0
- package/src/git/repositoryService.ts +179 -0
- package/src/git/service.ts +365 -0
- package/src/git/utils/autolink.utils.ts +201 -0
- package/src/git/utils/blame.utils.ts +296 -0
- package/src/git/utils/branch.utils.ts +154 -0
- package/src/git/utils/commit.utils.ts +89 -0
- package/src/git/utils/contributor.utils.ts +81 -0
- package/src/git/utils/fetch.utils.ts +48 -0
- package/src/git/utils/fileStatus.utils.ts +49 -0
- package/src/git/utils/issue.utils.ts +81 -0
- package/src/git/utils/issueOrPullRequest.utils.ts +23 -0
- package/src/git/utils/mergeConflicts.utils.ts +21 -0
- package/src/git/utils/pausedOperationStatus.utils.ts +156 -0
- package/src/git/utils/pullRequest.utils.ts +149 -0
- package/src/git/utils/rebase.utils.ts +128 -0
- package/src/git/utils/reference.utils.ts +267 -0
- package/src/git/utils/remote.utils.ts +140 -0
- package/src/git/utils/repository.utils.ts +18 -0
- package/src/git/utils/resourceDescriptor.utils.ts +26 -0
- package/src/git/utils/revision.utils.ts +149 -0
- package/src/git/utils/search.utils.ts +498 -0
- package/src/git/utils/sorting.ts +291 -0
- package/src/git/utils/status.utils.ts +114 -0
- package/src/git/utils/statusFile.utils.ts +182 -0
- package/src/git/utils/tag.utils.ts +17 -0
- package/src/git/utils/tooltip.utils.ts +37 -0
- package/src/git/utils/uriAuthority.ts +34 -0
- package/src/git/utils/user.utils.ts +20 -0
- package/src/git/utils/worktree.utils.ts +21 -0
- package/src/git/watching/changeEvent.ts +90 -0
- package/src/git/watching/classifyChange.ts +81 -0
- package/src/git/watching/gitIgnoreFilter.ts +134 -0
- package/src/git/watching/initWatcher.ts +79 -0
- package/src/git/watching/provider.ts +24 -0
- package/src/git/watching/watchGroup.ts +182 -0
- package/src/git/watching/watchService.ts +350 -0
- package/src/git/watching/watchSession.ts +370 -0
- package/src/git/watching/watcherPatterns.ts +51 -0
- package/src/git-cli/cliGitProvider.ts +436 -0
- package/src/git-cli/exec/exec.errors.ts +1 -0
- package/src/git-cli/exec/exec.ts +11 -0
- package/src/git-cli/exec/exec.types.ts +8 -0
- package/src/git-cli/exec/features.ts +2 -0
- package/src/git-cli/exec/git.ts +1092 -0
- package/src/git-cli/exec/gitQueue.ts +251 -0
- package/src/git-cli/exec/locator.ts +157 -0
- package/src/git-cli/parsers/blameParser.ts +373 -0
- package/src/git-cli/parsers/indexParser.ts +192 -0
- package/src/git-cli/parsers/logParser.ts +1275 -0
- package/src/git-cli/parsers/mergeTreeParser.ts +22 -0
- package/src/git-cli/parsers/refParser.ts +111 -0
- package/src/git-cli/parsers/reflogParser.ts +153 -0
- package/src/git-cli/parsers/remoteParser.ts +95 -0
- package/src/git-cli/parsers/shortlogParser.ts +59 -0
- package/src/git-cli/parsers/signatureParser.ts +162 -0
- package/src/git-cli/parsers/statusParser.ts +209 -0
- package/src/git-cli/parsers/treeParser.ts +61 -0
- package/src/git-cli/parsers/worktreeParser.ts +113 -0
- package/src/git-cli/providers/blame.ts +602 -0
- package/src/git-cli/providers/branches.ts +1491 -0
- package/src/git-cli/providers/commitFilesetUtils.ts +45 -0
- package/src/git-cli/providers/commits.ts +1517 -0
- package/src/git-cli/providers/config.ts +724 -0
- package/src/git-cli/providers/contributors.ts +361 -0
- package/src/git-cli/providers/diff.ts +1084 -0
- package/src/git-cli/providers/graph.ts +799 -0
- package/src/git-cli/providers/operations.ts +776 -0
- package/src/git-cli/providers/patch.ts +326 -0
- package/src/git-cli/providers/pausedOperations.ts +538 -0
- package/src/git-cli/providers/refs.ts +193 -0
- package/src/git-cli/providers/remotes.ts +115 -0
- package/src/git-cli/providers/revision.ts +334 -0
- package/src/git-cli/providers/staging.ts +160 -0
- package/src/git-cli/providers/stash.ts +626 -0
- package/src/git-cli/providers/status.ts +373 -0
- package/src/git-cli/providers/tags.ts +188 -0
- package/src/git-cli/providers/worktrees.ts +229 -0
- package/src/git-cli/service.ts +74 -0
- package/src/plus/ai/constants.ts +121 -0
- package/src/plus/ai/errors.ts +82 -0
- package/src/plus/ai/models/conversation.ts +35 -0
- package/src/plus/ai/models/model.ts +425 -0
- package/src/plus/ai/models/promptTemplates.ts +122 -0
- package/src/plus/ai/models/provider.ts +52 -0
- package/src/plus/ai/models/results.ts +1 -0
- package/src/plus/ai/prompts.ts +528 -0
- package/src/plus/ai/providers/anthropicProvider.ts +308 -0
- package/src/plus/ai/providers/azureProvider.ts +74 -0
- package/src/plus/ai/providers/context.ts +29 -0
- package/src/plus/ai/providers/deepSeekProvider.ts +40 -0
- package/src/plus/ai/providers/geminiProvider.ts +207 -0
- package/src/plus/ai/providers/githubModelsProvider.ts +92 -0
- package/src/plus/ai/providers/gitkrakenProvider.ts +218 -0
- package/src/plus/ai/providers/huggingFaceProvider.ts +51 -0
- package/src/plus/ai/providers/mistralProvider.ts +160 -0
- package/src/plus/ai/providers/ollamaProvider.ts +241 -0
- package/src/plus/ai/providers/openAICompatibleProvider.ts +59 -0
- package/src/plus/ai/providers/openAICompatibleProviderBase.ts +279 -0
- package/src/plus/ai/providers/openRouterProvider.ts +84 -0
- package/src/plus/ai/providers/openaiProvider.ts +46 -0
- package/src/plus/ai/providers/xaiProvider.ts +32 -0
- package/src/plus/ai/utils/ai.utils.ts +79 -0
- package/src/plus/ai/utils/results.utils.ts +50 -0
- package/src/plus/ai/utils/truncation.utils.ts +295 -0
- package/src/plus/git-github/api/config.ts +78 -0
- package/src/plus/git-github/api/github.ts +3424 -0
- package/src/plus/git-github/api/github.utils.ts +36 -0
- package/src/plus/git-github/api/token.ts +15 -0
- package/src/plus/git-github/api/tokenUtils.ts +15 -0
- package/src/plus/git-github/api/types.ts +182 -0
- package/src/plus/git-github/context.ts +107 -0
- package/src/plus/git-github/models.ts +524 -0
- package/src/plus/git-github/providers/github/blame.ts +222 -0
- package/src/plus/git-github/providers/github/branches.ts +356 -0
- package/src/plus/git-github/providers/github/commits.ts +858 -0
- package/src/plus/git-github/providers/github/config.ts +47 -0
- package/src/plus/git-github/providers/github/contributors.ts +313 -0
- package/src/plus/git-github/providers/github/diff.ts +267 -0
- package/src/plus/git-github/providers/github/graph.ts +511 -0
- package/src/plus/git-github/providers/github/refs.ts +137 -0
- package/src/plus/git-github/providers/github/remotes.ts +44 -0
- package/src/plus/git-github/providers/github/revision.ts +141 -0
- package/src/plus/git-github/providers/github/status.ts +63 -0
- package/src/plus/git-github/providers/github/tags.ts +147 -0
- package/src/plus/git-github/providers/githubGitProvider.ts +167 -0
- package/src/plus/git-github/providers/githubProvider.ts +65 -0
- package/src/utils/array.ts +194 -0
- package/src/utils/base64.ts +1 -0
- package/src/utils/brand.ts +9 -0
- package/src/utils/cancellation.ts +150 -0
- package/src/utils/charCode.ts +38 -0
- package/src/utils/color.ts +815 -0
- package/src/utils/counter.ts +21 -0
- package/src/utils/crypto.ts +1 -0
- package/src/utils/date.ts +394 -0
- package/src/utils/debounce.ts +303 -0
- package/src/utils/decorators/debounce.ts +31 -0
- package/src/utils/decorators/gate.ts +167 -0
- package/src/utils/decorators/log.ts +320 -0
- package/src/utils/decorators/memoize.ts +98 -0
- package/src/utils/decorators/resolver.ts +95 -0
- package/src/utils/decorators/sequentialize.ts +116 -0
- package/src/utils/decorators/serializable.ts +42 -0
- package/src/utils/disposable.ts +141 -0
- package/src/utils/encoding.ts +8 -0
- package/src/utils/env/browser/base64.ts +50 -0
- package/src/utils/env/browser/crypto.ts +21 -0
- package/src/utils/env/browser/fs.ts +3 -0
- package/src/utils/env/browser/hex.ts +41 -0
- package/src/utils/env/browser/hrtime.ts +14 -0
- package/src/utils/env/browser/logScope.ts +57 -0
- package/src/utils/env/browser/md5.ts +217 -0
- package/src/utils/env/browser/platform.ts +10 -0
- package/src/utils/env/node/base64.ts +17 -0
- package/src/utils/env/node/crypto.ts +17 -0
- package/src/utils/env/node/exec.ts +471 -0
- package/src/utils/env/node/fs.ts +5 -0
- package/src/utils/env/node/hex.ts +11 -0
- package/src/utils/env/node/hrtime.ts +1 -0
- package/src/utils/env/node/logScope.ts +63 -0
- package/src/utils/env/node/platform.ts +5 -0
- package/src/utils/error.ts +17 -0
- package/src/utils/event.ts +236 -0
- package/src/utils/formatter.ts +205 -0
- package/src/utils/fs.ts +1 -0
- package/src/utils/function.ts +141 -0
- package/src/utils/fuzzy.ts +185 -0
- package/src/utils/hash.ts +60 -0
- package/src/utils/hex.ts +1 -0
- package/src/utils/hrtime.ts +8 -0
- package/src/utils/iterable.ts +787 -0
- package/src/utils/lazy.ts +39 -0
- package/src/utils/loggable.ts +7 -0
- package/src/utils/logger.scoped.ts +237 -0
- package/src/utils/logger.ts +402 -0
- package/src/utils/markdown.ts +114 -0
- package/src/utils/mru.ts +66 -0
- package/src/utils/object.ts +227 -0
- package/src/utils/paging.ts +51 -0
- package/src/utils/path.ts +189 -0
- package/src/utils/platform.ts +1 -0
- package/src/utils/promise.ts +590 -0
- package/src/utils/promiseCache.ts +803 -0
- package/src/utils/searchTree.ts +442 -0
- package/src/utils/stopwatch.ts +125 -0
- package/src/utils/string.ts +964 -0
- package/src/utils/subscriptionManager.ts +40 -0
- package/src/utils/trie.ts +739 -0
- package/src/utils/types.ts +31 -0
- package/src/utils/uri.ts +117 -0
- package/src/utils/validation.ts +38 -0
- package/src/utils/version.ts +79 -0
|
@@ -0,0 +1,1491 @@
|
|
|
1
|
+
import type { Cache, ConflictDetectionCacheKey } from '../../git/cache.js';
|
|
2
|
+
import type { GitServiceContext } from '../../git/context.js';
|
|
3
|
+
import { BranchError } from '../../git/errors.js';
|
|
4
|
+
import type { BranchDisposition, BranchMetadata } from '../../git/models/branch.js';
|
|
5
|
+
import { GitBranch } from '../../git/models/branch.js';
|
|
6
|
+
import type { ConflictDetectionResult } from '../../git/models/mergeConflicts.js';
|
|
7
|
+
import type { GitBranchReference } from '../../git/models/reference.js';
|
|
8
|
+
import type {
|
|
9
|
+
BranchContributionsOverview,
|
|
10
|
+
GitBranchesSubProvider,
|
|
11
|
+
GitBranchMergedStatus,
|
|
12
|
+
} from '../../git/providers/branches.js';
|
|
13
|
+
import {
|
|
14
|
+
formatDetachedHeadName,
|
|
15
|
+
getBranchId,
|
|
16
|
+
getLocalBranchByUpstream,
|
|
17
|
+
isDetachedHead,
|
|
18
|
+
isRemoteHEAD,
|
|
19
|
+
parseRefName,
|
|
20
|
+
parseUpstream,
|
|
21
|
+
} from '../../git/utils/branch.utils.js';
|
|
22
|
+
import { createConflictDetectionError } from '../../git/utils/mergeConflicts.utils.js';
|
|
23
|
+
import { createReference } from '../../git/utils/reference.utils.js';
|
|
24
|
+
import { createRevisionRange, shortenRevision } from '../../git/utils/revision.utils.js';
|
|
25
|
+
import type { BranchSortOptions } from '../../git/utils/sorting.js';
|
|
26
|
+
import { sortBranches, sortContributors } from '../../git/utils/sorting.js';
|
|
27
|
+
import { ensureArray, filterMap } from '../../utils/array.js';
|
|
28
|
+
import { CancellationError, isCancellationError } from '../../utils/cancellation.js';
|
|
29
|
+
import { debounce } from '../../utils/decorators/debounce.js';
|
|
30
|
+
import { debug } from '../../utils/decorators/log.js';
|
|
31
|
+
import { Logger } from '../../utils/logger.js';
|
|
32
|
+
import { getScopedLogger } from '../../utils/logger.scoped.js';
|
|
33
|
+
import type { PagedResult, PagingOptions } from '../../utils/paging.js';
|
|
34
|
+
import { emptyPagedResult, PageableResult } from '../../utils/paging.js';
|
|
35
|
+
import { normalizePath } from '../../utils/path.js';
|
|
36
|
+
import { getSettledValue } from '../../utils/promise.js';
|
|
37
|
+
import type { CacheController } from '../../utils/promiseCache.js';
|
|
38
|
+
import { maybeStopWatch } from '../../utils/stopwatch.js';
|
|
39
|
+
import type { CliGitProviderInternal } from '../cliGitProvider.js';
|
|
40
|
+
import type { GitResult } from '../exec/exec.types.js';
|
|
41
|
+
import type { Git } from '../exec/git.js';
|
|
42
|
+
import { getGitCommandError, gitConfigsBranch, gitConfigsLog, GitError, GitErrors, GitWarnings } from '../exec/git.js';
|
|
43
|
+
import { parseMergeTreeConflict } from '../parsers/mergeTreeParser.js';
|
|
44
|
+
import { getBranchParser } from '../parsers/refParser.js';
|
|
45
|
+
|
|
46
|
+
/** Minimum time between writes to the config for last accessed/modified dates */
|
|
47
|
+
const dateMetadataStaleThresholdMs = 5 * 60 * 1000; // 5 minutes
|
|
48
|
+
|
|
49
|
+
export class BranchesGitSubProvider implements GitBranchesSubProvider {
|
|
50
|
+
constructor(
|
|
51
|
+
private readonly context: GitServiceContext,
|
|
52
|
+
private readonly git: Git,
|
|
53
|
+
private readonly cache: Cache,
|
|
54
|
+
private readonly provider: CliGitProviderInternal,
|
|
55
|
+
) {}
|
|
56
|
+
|
|
57
|
+
@debug()
|
|
58
|
+
async getBranch(repoPath: string, name?: string, cancellation?: AbortSignal): Promise<GitBranch | undefined> {
|
|
59
|
+
if (name != null) {
|
|
60
|
+
const {
|
|
61
|
+
values: [branch],
|
|
62
|
+
} = await this.getBranches(repoPath, { filter: b => b.name === name }, cancellation);
|
|
63
|
+
return branch;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const branchPromise = this.cache.branch.getOrCreate(
|
|
67
|
+
repoPath,
|
|
68
|
+
async (_cacheable, signal) => {
|
|
69
|
+
const {
|
|
70
|
+
values: [branch],
|
|
71
|
+
} = await this.getBranches(repoPath, { filter: b => b.current }, signal);
|
|
72
|
+
return branch ?? this.getCurrentBranch(repoPath, undefined, undefined, signal);
|
|
73
|
+
},
|
|
74
|
+
cancellation,
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
if (branchPromise == null) {
|
|
78
|
+
const {
|
|
79
|
+
values: [branch],
|
|
80
|
+
} = await this.getBranches(repoPath, { filter: b => b.current }, cancellation);
|
|
81
|
+
return branch ?? this.getCurrentBranch(repoPath, undefined, undefined, cancellation);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return branchPromise;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private async getCurrentBranch(
|
|
88
|
+
repoPath: string,
|
|
89
|
+
metadataMap: Map<string, BranchMetadata> | undefined,
|
|
90
|
+
ordering: string | undefined,
|
|
91
|
+
cancellation?: AbortSignal,
|
|
92
|
+
): Promise<GitBranch | undefined> {
|
|
93
|
+
const ref = await this.getCurrentBranchReferenceCore(repoPath, ordering, cancellation);
|
|
94
|
+
if (ref == null) return undefined;
|
|
95
|
+
|
|
96
|
+
const [pausedOpStatusResult, committerDateResult, defaultWorktreePathResult, metadataMapResult] =
|
|
97
|
+
await Promise.allSettled([
|
|
98
|
+
isDetachedHead(ref.name)
|
|
99
|
+
? this.provider.pausedOps?.getPausedOperationStatus(repoPath, cancellation)
|
|
100
|
+
: undefined,
|
|
101
|
+
this.git
|
|
102
|
+
.exec(
|
|
103
|
+
{
|
|
104
|
+
cwd: repoPath,
|
|
105
|
+
cancellation: cancellation,
|
|
106
|
+
configs: gitConfigsLog,
|
|
107
|
+
errors: 'ignore',
|
|
108
|
+
},
|
|
109
|
+
'log',
|
|
110
|
+
'-n1',
|
|
111
|
+
'--format=%ct',
|
|
112
|
+
ordering ? `--${ordering}-order` : undefined,
|
|
113
|
+
'--',
|
|
114
|
+
)
|
|
115
|
+
.then(result => (result.stdout ? result.stdout.trim() : undefined)),
|
|
116
|
+
this.provider.config.getDefaultWorktreePath?.(repoPath),
|
|
117
|
+
metadataMap != null ? Promise.resolve(metadataMap) : this.getBranchMetadataMap(repoPath),
|
|
118
|
+
]);
|
|
119
|
+
|
|
120
|
+
const committerDate = getSettledValue(committerDateResult);
|
|
121
|
+
const pausedOpStatus = getSettledValue(pausedOpStatusResult);
|
|
122
|
+
const rebaseStatus = pausedOpStatus?.type === 'rebase' ? pausedOpStatus : undefined;
|
|
123
|
+
const defaultWorktreePath = getSettledValue(defaultWorktreePathResult);
|
|
124
|
+
metadataMap ??= getSettledValue(metadataMapResult);
|
|
125
|
+
const metadata = metadataMap?.get(ref.name);
|
|
126
|
+
|
|
127
|
+
if (cancellation?.aborted) throw new CancellationError();
|
|
128
|
+
|
|
129
|
+
const branchRefName = rebaseStatus?.incoming.name ?? `refs/heads/${ref.name}`;
|
|
130
|
+
|
|
131
|
+
const branch = new GitBranch(
|
|
132
|
+
repoPath, // Use worktree-specific path for consistent IDs within each worktree
|
|
133
|
+
branchRefName,
|
|
134
|
+
true,
|
|
135
|
+
committerDate != null ? new Date(Number(committerDate) * 1000) : undefined,
|
|
136
|
+
metadata,
|
|
137
|
+
ref.sha,
|
|
138
|
+
ref.upstream ? { ...ref.upstream, state: { ahead: 0, behind: 0 } } : undefined,
|
|
139
|
+
{ path: repoPath, isDefault: repoPath === defaultWorktreePath },
|
|
140
|
+
undefined,
|
|
141
|
+
rebaseStatus != null,
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
return branch;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@debug({ args: repoPath => ({ repoPath: repoPath }) })
|
|
148
|
+
async getBranches(
|
|
149
|
+
repoPath: string,
|
|
150
|
+
options?: {
|
|
151
|
+
filter?: (b: GitBranch) => boolean;
|
|
152
|
+
ordering?: 'date' | 'author-date' | 'topo' | null;
|
|
153
|
+
paging?: PagingOptions;
|
|
154
|
+
sort?: boolean | BranchSortOptions;
|
|
155
|
+
},
|
|
156
|
+
cancellation?: AbortSignal,
|
|
157
|
+
): Promise<PagedResult<GitBranch>> {
|
|
158
|
+
if (repoPath == null) return emptyPagedResult;
|
|
159
|
+
|
|
160
|
+
const scope = getScopedLogger();
|
|
161
|
+
|
|
162
|
+
const getCore = async (
|
|
163
|
+
commonPath: string,
|
|
164
|
+
cacheable?: CacheController,
|
|
165
|
+
signal?: AbortSignal,
|
|
166
|
+
): Promise<PagedResult<GitBranch>> => {
|
|
167
|
+
// Prefer the aggregate signal from the cache when present; fall back to the caller's
|
|
168
|
+
// own cancellation when bypassing the cache (e.g. paging-cursor path).
|
|
169
|
+
signal ??= cancellation;
|
|
170
|
+
try {
|
|
171
|
+
const supported = await this.git.supported('git:for-each-ref');
|
|
172
|
+
const parser = getBranchParser(supported);
|
|
173
|
+
|
|
174
|
+
const [gitResult, defaultWorktreePathResult, metadataMapResult] = await Promise.allSettled([
|
|
175
|
+
this.git.exec(
|
|
176
|
+
{ cwd: commonPath, cancellation: signal },
|
|
177
|
+
'for-each-ref',
|
|
178
|
+
...parser.arguments,
|
|
179
|
+
'refs/heads/',
|
|
180
|
+
'refs/remotes/',
|
|
181
|
+
),
|
|
182
|
+
this.provider.config.getDefaultWorktreePath?.(commonPath),
|
|
183
|
+
this.getBranchMetadataMap(commonPath),
|
|
184
|
+
]);
|
|
185
|
+
|
|
186
|
+
const result = getSettledValue(gitResult);
|
|
187
|
+
const metadataMap = getSettledValue(metadataMapResult) ?? new Map<string, BranchMetadata>();
|
|
188
|
+
const defaultWorktreePath = getSettledValue(defaultWorktreePathResult);
|
|
189
|
+
|
|
190
|
+
// If we don't get any data, assume the repo doesn't have any commits yet so check if we have a current branch
|
|
191
|
+
if (!result?.stdout) {
|
|
192
|
+
const current = await this.getCurrentBranch(
|
|
193
|
+
commonPath,
|
|
194
|
+
metadataMap,
|
|
195
|
+
options?.ordering ?? this.context.config?.commits.ordering ?? undefined,
|
|
196
|
+
signal,
|
|
197
|
+
);
|
|
198
|
+
return current != null ? { values: [current] } : emptyPagedResult;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
using sw = maybeStopWatch(scope, { log: { onlyExit: true, level: 'debug' } });
|
|
202
|
+
|
|
203
|
+
const branches: GitBranch[] = [];
|
|
204
|
+
|
|
205
|
+
for (const entry of parser.parse(result.stdout)) {
|
|
206
|
+
// Skip HEAD refs in remote branches
|
|
207
|
+
if (isRemoteHEAD(entry.name)) continue;
|
|
208
|
+
|
|
209
|
+
const upstream = parseUpstream(entry.upstream, entry.upstreamTracking);
|
|
210
|
+
|
|
211
|
+
const metadata = metadataMap.get(parseRefName(entry.name).name);
|
|
212
|
+
const worktreePath = entry.worktreePath ? normalizePath(entry.worktreePath) : undefined;
|
|
213
|
+
|
|
214
|
+
branches.push(
|
|
215
|
+
new GitBranch(
|
|
216
|
+
commonPath,
|
|
217
|
+
entry.name,
|
|
218
|
+
false, // Don't trust %(HEAD) for current as it's per-worktree -- we will set it later
|
|
219
|
+
entry.date ? new Date(entry.date) : undefined,
|
|
220
|
+
metadata,
|
|
221
|
+
entry.sha,
|
|
222
|
+
upstream,
|
|
223
|
+
supported.includes('git:for-each-ref:worktreePath')
|
|
224
|
+
? worktreePath
|
|
225
|
+
? { path: worktreePath, isDefault: worktreePath === defaultWorktreePath }
|
|
226
|
+
: false
|
|
227
|
+
: undefined,
|
|
228
|
+
),
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
sw?.stop({ suffix: ` parsed ${branches.length} branches` });
|
|
233
|
+
|
|
234
|
+
// Pre-populate current branch cache for worktrees based on worktreePath info
|
|
235
|
+
// This eliminates the need for rev-parse calls during branch reconstruction
|
|
236
|
+
for (const branch of branches) {
|
|
237
|
+
if (branch.worktree && branch.worktree.path) {
|
|
238
|
+
const { name } = parseRefName(branch.refName);
|
|
239
|
+
const reference = createReference(name, branch.worktree.path, {
|
|
240
|
+
refType: 'branch',
|
|
241
|
+
name: name,
|
|
242
|
+
id: getBranchId(branch.worktree.path, false, name),
|
|
243
|
+
remote: false,
|
|
244
|
+
upstream: branch.upstream?.name
|
|
245
|
+
? { name: branch.upstream.name, missing: branch.upstream.missing }
|
|
246
|
+
: undefined,
|
|
247
|
+
sha: branch.sha,
|
|
248
|
+
});
|
|
249
|
+
this.cache.setCurrentBranchReferenceIfAbsent(branch.worktree.path, reference);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return branches.length ? { values: branches } : emptyPagedResult;
|
|
254
|
+
} catch (ex) {
|
|
255
|
+
// Signal cache invalidation so the shared cache entry is cleaned up
|
|
256
|
+
cacheable?.invalidate();
|
|
257
|
+
if (isCancellationError(ex)) throw ex;
|
|
258
|
+
|
|
259
|
+
return emptyPagedResult;
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
// Mapper function that adjusts branches for a specific worktree
|
|
264
|
+
const mapBranches = async (
|
|
265
|
+
shared: PagedResult<GitBranch>,
|
|
266
|
+
targetRepoPath: string,
|
|
267
|
+
commonPath: string,
|
|
268
|
+
mapperSignal?: AbortSignal,
|
|
269
|
+
): Promise<PagedResult<GitBranch>> => {
|
|
270
|
+
if (!shared.values.length) return shared;
|
|
271
|
+
|
|
272
|
+
// Prefer the mapper's per-entry aggregate signal when present; fall back to the
|
|
273
|
+
// caller's own cancellation when bypassing the cache (paging-cursor path).
|
|
274
|
+
mapperSignal ??= cancellation;
|
|
275
|
+
|
|
276
|
+
// Get current branch info and default worktree path for the target worktree
|
|
277
|
+
const [currentRefResult, defaultWorktreePathResult] = await Promise.allSettled([
|
|
278
|
+
this.getCurrentBranchReferenceCore(targetRepoPath, undefined, mapperSignal),
|
|
279
|
+
this.provider.config.getDefaultWorktreePath?.(commonPath),
|
|
280
|
+
]);
|
|
281
|
+
const currentRef = getSettledValue(currentRefResult);
|
|
282
|
+
const defaultWorktreePath = getSettledValue(defaultWorktreePathResult);
|
|
283
|
+
const isDetached = currentRef != null && isDetachedHead(currentRef.name);
|
|
284
|
+
|
|
285
|
+
// Clone branches with correct repoPath and current flag
|
|
286
|
+
const branches: GitBranch[] = shared.values.map(b => {
|
|
287
|
+
// Check if this branch is current in the target worktree
|
|
288
|
+
const isCurrent = !b.remote && b.name === currentRef?.name && !isDetached;
|
|
289
|
+
|
|
290
|
+
// Only create new object if something changed
|
|
291
|
+
if (!isCurrent && targetRepoPath === commonPath) return b;
|
|
292
|
+
|
|
293
|
+
return new GitBranch(
|
|
294
|
+
targetRepoPath, // Use target worktree path
|
|
295
|
+
b.refName,
|
|
296
|
+
isCurrent,
|
|
297
|
+
b.date,
|
|
298
|
+
b.metadata,
|
|
299
|
+
b.sha,
|
|
300
|
+
b.upstream,
|
|
301
|
+
// For current branch, ensure worktree is set (fallback when git doesn't support worktreePath)
|
|
302
|
+
isCurrent
|
|
303
|
+
? (b.worktree ?? { path: targetRepoPath, isDefault: targetRepoPath === defaultWorktreePath })
|
|
304
|
+
: b.worktree,
|
|
305
|
+
false, // detached - only true for detached HEAD branch itself
|
|
306
|
+
false, // rebasing - only true for detached HEAD branch in rebase
|
|
307
|
+
);
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
// Handle detached HEAD - need to create a special branch for it
|
|
311
|
+
if (isDetached || (currentRef != null && !branches.some(b => b.current))) {
|
|
312
|
+
const metadataMap = await this.getBranchMetadataMap(commonPath);
|
|
313
|
+
const current = await this.getCurrentBranch(
|
|
314
|
+
targetRepoPath,
|
|
315
|
+
metadataMap,
|
|
316
|
+
options?.ordering ?? this.context.config?.commits.ordering ?? undefined,
|
|
317
|
+
mapperSignal,
|
|
318
|
+
);
|
|
319
|
+
if (current != null) {
|
|
320
|
+
// Replace if exists (by id), otherwise prepend
|
|
321
|
+
const index = branches.findIndex(b => b.id === current.id);
|
|
322
|
+
if (index !== -1) {
|
|
323
|
+
branches[index] = current;
|
|
324
|
+
} else {
|
|
325
|
+
branches.unshift(current);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
return { ...shared, values: branches };
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
let result: PagedResult<GitBranch>;
|
|
334
|
+
|
|
335
|
+
// Use paging cursor to bypass cache if paginating
|
|
336
|
+
if (options?.paging?.cursor != null) {
|
|
337
|
+
const commonPath = this.cache.getCommonPath(repoPath);
|
|
338
|
+
const shared = await getCore(commonPath);
|
|
339
|
+
// Still apply the mapper to ensure correct repoPath and current flag for the requesting worktree
|
|
340
|
+
result = await mapBranches(shared, repoPath, commonPath);
|
|
341
|
+
} else {
|
|
342
|
+
result = await this.cache.getBranches(repoPath, getCore, mapBranches, cancellation);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
if (options?.filter != null) {
|
|
346
|
+
result = {
|
|
347
|
+
...result,
|
|
348
|
+
values: result.values.filter(options.filter),
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (options?.sort) {
|
|
353
|
+
sortBranches(result.values, typeof options.sort === 'boolean' ? undefined : options.sort);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
return result;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
@debug()
|
|
360
|
+
async getBranchContributionsOverview(
|
|
361
|
+
repoPath: string,
|
|
362
|
+
ref: string,
|
|
363
|
+
options?: { associatedPullRequest?: Promise<{ refs?: { base?: { branch: string } } } | undefined> },
|
|
364
|
+
cancellation?: AbortSignal,
|
|
365
|
+
): Promise<BranchContributionsOverview | undefined> {
|
|
366
|
+
const scope = getScopedLogger();
|
|
367
|
+
|
|
368
|
+
try {
|
|
369
|
+
const branch = await this.getBranch(repoPath, ref, cancellation);
|
|
370
|
+
if (branch == null) return undefined;
|
|
371
|
+
|
|
372
|
+
let mergeTarget: string | undefined;
|
|
373
|
+
|
|
374
|
+
// Tier 1: Check stored merge target (user-set or previously detected from PR)
|
|
375
|
+
const storedTarget = await this.getStoredMergeTargetBranchName(repoPath, ref);
|
|
376
|
+
if (storedTarget) {
|
|
377
|
+
const validated = await this.provider.refs.getSymbolicReferenceName(repoPath, storedTarget);
|
|
378
|
+
mergeTarget = validated || storedTarget;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
// Tier 2: PR-based lookup (caller provides the PR promise)
|
|
382
|
+
if (mergeTarget == null && options?.associatedPullRequest != null) {
|
|
383
|
+
const pr = await options.associatedPullRequest;
|
|
384
|
+
if (pr?.refs?.base != null) {
|
|
385
|
+
mergeTarget = `${branch.remoteName}/${pr.refs.base.branch}`;
|
|
386
|
+
// Store for future reuse
|
|
387
|
+
void this.storeMergeTargetBranchName(repoPath, ref, mergeTarget);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// Tier 3: Base branch, then default branch
|
|
392
|
+
mergeTarget ??= await this.getBaseBranchName(repoPath, ref, cancellation);
|
|
393
|
+
mergeTarget ??= await this.getDefaultBranchName(repoPath, undefined, cancellation);
|
|
394
|
+
|
|
395
|
+
if (mergeTarget == null) return undefined;
|
|
396
|
+
|
|
397
|
+
const mergeBase = await this.provider.refs.getMergeBase(
|
|
398
|
+
repoPath,
|
|
399
|
+
ref,
|
|
400
|
+
mergeTarget,
|
|
401
|
+
undefined,
|
|
402
|
+
cancellation,
|
|
403
|
+
);
|
|
404
|
+
if (mergeBase == null) return undefined;
|
|
405
|
+
|
|
406
|
+
const result = await this.provider.contributors.getContributors(
|
|
407
|
+
repoPath,
|
|
408
|
+
createRevisionRange(mergeBase, ref, '..'),
|
|
409
|
+
{ stats: true },
|
|
410
|
+
cancellation,
|
|
411
|
+
);
|
|
412
|
+
|
|
413
|
+
sortContributors(result.contributors, { orderBy: 'score:desc' });
|
|
414
|
+
|
|
415
|
+
let totalCommits = 0;
|
|
416
|
+
let totalFiles = 0;
|
|
417
|
+
let totalAdditions = 0;
|
|
418
|
+
let totalDeletions = 0;
|
|
419
|
+
let firstCommitTimestamp;
|
|
420
|
+
let latestCommitTimestamp;
|
|
421
|
+
|
|
422
|
+
for (const c of result.contributors) {
|
|
423
|
+
totalCommits += c.contributionCount;
|
|
424
|
+
totalFiles += c.stats?.files ?? 0;
|
|
425
|
+
totalAdditions += c.stats?.additions ?? 0;
|
|
426
|
+
totalDeletions += c.stats?.deletions ?? 0;
|
|
427
|
+
|
|
428
|
+
const firstTimestamp = c.firstCommitDate?.getTime();
|
|
429
|
+
const latestTimestamp = c.latestCommitDate?.getTime();
|
|
430
|
+
|
|
431
|
+
if (firstTimestamp != null || latestTimestamp != null) {
|
|
432
|
+
firstCommitTimestamp =
|
|
433
|
+
firstCommitTimestamp != null
|
|
434
|
+
? Math.min(firstCommitTimestamp, firstTimestamp ?? Infinity, latestTimestamp ?? Infinity)
|
|
435
|
+
: (firstTimestamp ?? latestTimestamp);
|
|
436
|
+
|
|
437
|
+
latestCommitTimestamp =
|
|
438
|
+
latestCommitTimestamp != null
|
|
439
|
+
? Math.max(latestCommitTimestamp, firstTimestamp ?? -Infinity, latestTimestamp ?? -Infinity)
|
|
440
|
+
: (latestTimestamp ?? firstTimestamp);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
return {
|
|
445
|
+
repoPath: repoPath,
|
|
446
|
+
branch: ref,
|
|
447
|
+
mergeTarget: mergeTarget,
|
|
448
|
+
mergeBase: mergeBase,
|
|
449
|
+
|
|
450
|
+
commits: totalCommits,
|
|
451
|
+
files: totalFiles,
|
|
452
|
+
additions: totalAdditions,
|
|
453
|
+
deletions: totalDeletions,
|
|
454
|
+
|
|
455
|
+
latestCommitDate: latestCommitTimestamp != null ? new Date(latestCommitTimestamp) : undefined,
|
|
456
|
+
firstCommitDate: firstCommitTimestamp != null ? new Date(firstCommitTimestamp) : undefined,
|
|
457
|
+
|
|
458
|
+
contributors: result.contributors,
|
|
459
|
+
};
|
|
460
|
+
} catch (ex) {
|
|
461
|
+
scope?.error(ex);
|
|
462
|
+
if (isCancellationError(ex)) throw ex;
|
|
463
|
+
|
|
464
|
+
return undefined;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
@debug()
|
|
469
|
+
async getBranchesWithCommits(
|
|
470
|
+
repoPath: string,
|
|
471
|
+
commits: string[],
|
|
472
|
+
branch?: string,
|
|
473
|
+
options?:
|
|
474
|
+
| { all?: boolean; commitDate?: Date; mode?: 'contains' | 'pointsAt' }
|
|
475
|
+
| { commitDate?: Date; mode?: 'contains' | 'pointsAt'; remotes?: boolean },
|
|
476
|
+
cancellation?: AbortSignal,
|
|
477
|
+
): Promise<string[]> {
|
|
478
|
+
if (branch != null) {
|
|
479
|
+
const result = await this.branchesContainingCore(
|
|
480
|
+
repoPath,
|
|
481
|
+
commits,
|
|
482
|
+
{ mode: 'contains', name: branch },
|
|
483
|
+
cancellation,
|
|
484
|
+
);
|
|
485
|
+
const data = result.stdout.trim();
|
|
486
|
+
return data ? [data] : [];
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
const result = await this.branchesContainingCore(repoPath, commits, options, cancellation);
|
|
490
|
+
if (!result.stdout) return [];
|
|
491
|
+
|
|
492
|
+
return filterMap(result.stdout.split('\n'), b => b.trim() || undefined);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
private async branchesContainingCore(
|
|
496
|
+
repoPath: string,
|
|
497
|
+
refs: string[],
|
|
498
|
+
options?: {
|
|
499
|
+
all?: boolean;
|
|
500
|
+
mode?: 'contains' | 'pointsAt';
|
|
501
|
+
name?: string;
|
|
502
|
+
remotes?: boolean;
|
|
503
|
+
},
|
|
504
|
+
cancellation?: AbortSignal,
|
|
505
|
+
): Promise<GitResult> {
|
|
506
|
+
const params: string[] = ['branch'];
|
|
507
|
+
if (options?.all) {
|
|
508
|
+
params.push('-a');
|
|
509
|
+
} else if (options?.remotes) {
|
|
510
|
+
params.push('-r');
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
params.push('--format=%(refname:short)');
|
|
514
|
+
|
|
515
|
+
for (const ref of refs) {
|
|
516
|
+
params.push(options?.mode === 'pointsAt' ? `--points-at=${ref}` : `--contains=${ref}`);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
if (options?.name != null) {
|
|
520
|
+
params.push(options.name);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
return this.git.exec(
|
|
524
|
+
{
|
|
525
|
+
cwd: repoPath,
|
|
526
|
+
cancellation: cancellation,
|
|
527
|
+
configs: gitConfigsBranch,
|
|
528
|
+
errors: 'ignore',
|
|
529
|
+
},
|
|
530
|
+
...params,
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
@debug()
|
|
535
|
+
async getCurrentBranchReference(
|
|
536
|
+
repoPath: string,
|
|
537
|
+
cancellation?: AbortSignal,
|
|
538
|
+
): Promise<GitBranchReference | undefined> {
|
|
539
|
+
let ref = await this.getCurrentBranchReferenceCore(repoPath, undefined, cancellation);
|
|
540
|
+
if (ref != null && isDetachedHead(ref.name)) {
|
|
541
|
+
ref = createReference(ref.sha!, repoPath, {
|
|
542
|
+
refType: 'branch',
|
|
543
|
+
name: formatDetachedHeadName(ref.sha!),
|
|
544
|
+
id: getBranchId(repoPath, ref.remote, ref.sha!),
|
|
545
|
+
remote: ref.remote,
|
|
546
|
+
upstream: ref.upstream,
|
|
547
|
+
sha: ref.sha,
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
return ref;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
private getCurrentBranchReferenceCore(
|
|
554
|
+
repoPath: string,
|
|
555
|
+
ordering?: string,
|
|
556
|
+
cancellation?: AbortSignal,
|
|
557
|
+
): Promise<GitBranchReference | undefined> {
|
|
558
|
+
return this.cache.currentBranchReference.getOrCreate(
|
|
559
|
+
repoPath,
|
|
560
|
+
async (_cacheable, signal) => {
|
|
561
|
+
const commitOrdering = ordering;
|
|
562
|
+
|
|
563
|
+
let data: [string, string | undefined] | undefined;
|
|
564
|
+
let result;
|
|
565
|
+
try {
|
|
566
|
+
result = await this.git.exec(
|
|
567
|
+
{ cwd: repoPath, cancellation: signal, errors: 'throw' },
|
|
568
|
+
'rev-parse',
|
|
569
|
+
'--abbrev-ref',
|
|
570
|
+
'--symbolic-full-name',
|
|
571
|
+
'@',
|
|
572
|
+
'@{u}',
|
|
573
|
+
'--',
|
|
574
|
+
);
|
|
575
|
+
data = [result.stdout, undefined];
|
|
576
|
+
} catch (ex) {
|
|
577
|
+
if (isCancellationError(ex)) throw ex;
|
|
578
|
+
|
|
579
|
+
const msg: string = ex?.toString() ?? '';
|
|
580
|
+
if (GitErrors.badRevision.test(msg) || GitWarnings.noUpstream.test(msg)) {
|
|
581
|
+
if (ex.stdout != null && ex.stdout.length !== 0) {
|
|
582
|
+
data = [ex.stdout, undefined];
|
|
583
|
+
} else {
|
|
584
|
+
try {
|
|
585
|
+
result = await this.git.exec(
|
|
586
|
+
{ cwd: repoPath, cancellation: signal },
|
|
587
|
+
'symbolic-ref',
|
|
588
|
+
'--short',
|
|
589
|
+
'HEAD',
|
|
590
|
+
);
|
|
591
|
+
if (result.stdout) {
|
|
592
|
+
data = [result.stdout.trim(), undefined];
|
|
593
|
+
}
|
|
594
|
+
} catch {
|
|
595
|
+
if (isCancellationError(ex)) throw ex;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
if (data == null) {
|
|
599
|
+
const symbolicRef = await this.getDefaultBranchName(repoPath, 'origin', signal);
|
|
600
|
+
if (symbolicRef != null) {
|
|
601
|
+
data = [
|
|
602
|
+
symbolicRef.startsWith('origin/')
|
|
603
|
+
? symbolicRef.substring('origin/'.length)
|
|
604
|
+
: symbolicRef,
|
|
605
|
+
undefined,
|
|
606
|
+
];
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
if (data == null) {
|
|
611
|
+
const defaultBranch =
|
|
612
|
+
(await this.provider.config.getConfig(repoPath, 'init.defaultBranch')) ?? 'main';
|
|
613
|
+
const configMap = await this.provider.config.getConfigRegex(
|
|
614
|
+
repoPath,
|
|
615
|
+
`branch\\.${defaultBranch}\\.+`,
|
|
616
|
+
{ runGitLocally: true },
|
|
617
|
+
);
|
|
618
|
+
|
|
619
|
+
const remote = configMap.get(`branch.${defaultBranch}.remote`);
|
|
620
|
+
const merge = configMap.get(`branch.${defaultBranch}.merge`);
|
|
621
|
+
const remoteBranch = merge?.startsWith('refs/heads/')
|
|
622
|
+
? merge.substring('refs/heads/'.length)
|
|
623
|
+
: undefined;
|
|
624
|
+
|
|
625
|
+
data = [
|
|
626
|
+
`${defaultBranch}${remote && remoteBranch ? `\n${remote}/${remoteBranch}` : ''}`,
|
|
627
|
+
undefined,
|
|
628
|
+
];
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
} else if (GitWarnings.headNotABranch.test(msg)) {
|
|
632
|
+
result = await this.git.exec(
|
|
633
|
+
{
|
|
634
|
+
cwd: repoPath,
|
|
635
|
+
cancellation: signal,
|
|
636
|
+
configs: gitConfigsLog,
|
|
637
|
+
errors: 'ignore',
|
|
638
|
+
},
|
|
639
|
+
'log',
|
|
640
|
+
'-n1',
|
|
641
|
+
'--format=%H',
|
|
642
|
+
commitOrdering ? `--${commitOrdering}-order` : undefined,
|
|
643
|
+
'--',
|
|
644
|
+
);
|
|
645
|
+
|
|
646
|
+
if (result.cancelled || signal?.aborted) {
|
|
647
|
+
throw new CancellationError();
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
const sha = result.stdout.trim();
|
|
651
|
+
if (sha) {
|
|
652
|
+
data = [`(HEAD detached at ${shortenRevision(sha)})`, sha];
|
|
653
|
+
}
|
|
654
|
+
} else {
|
|
655
|
+
Logger.warn(`[${repoPath}] Unable to get current branch: ${ex}`);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
if (data == null) return undefined;
|
|
660
|
+
|
|
661
|
+
const [name, upstream] = data[0].split('\n');
|
|
662
|
+
|
|
663
|
+
return createReference(name, repoPath, {
|
|
664
|
+
refType: 'branch',
|
|
665
|
+
name: name,
|
|
666
|
+
id: getBranchId(repoPath, false, name),
|
|
667
|
+
remote: false,
|
|
668
|
+
upstream: upstream ? { name: upstream, missing: false } : undefined,
|
|
669
|
+
sha: data[1],
|
|
670
|
+
});
|
|
671
|
+
},
|
|
672
|
+
{ cancellation: cancellation },
|
|
673
|
+
);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
@debug({ exit: true })
|
|
677
|
+
async getDefaultBranchName(
|
|
678
|
+
repoPath: string | undefined,
|
|
679
|
+
remote?: string,
|
|
680
|
+
cancellation?: AbortSignal,
|
|
681
|
+
): Promise<string | undefined> {
|
|
682
|
+
if (repoPath == null) return undefined;
|
|
683
|
+
|
|
684
|
+
remote ??= 'origin';
|
|
685
|
+
|
|
686
|
+
return this.cache.getDefaultBranchName(repoPath, remote, async commonPath => {
|
|
687
|
+
let retried = false;
|
|
688
|
+
while (true) {
|
|
689
|
+
try {
|
|
690
|
+
const result = await this.git.exec(
|
|
691
|
+
{ cwd: commonPath, cancellation: cancellation },
|
|
692
|
+
'symbolic-ref',
|
|
693
|
+
'--short',
|
|
694
|
+
`refs/remotes/${remote}/HEAD`,
|
|
695
|
+
);
|
|
696
|
+
return result.stdout.trim() || undefined;
|
|
697
|
+
} catch (ex) {
|
|
698
|
+
if (/is not a symbolic ref/.test(ex.stderr)) {
|
|
699
|
+
try {
|
|
700
|
+
if (!retried) {
|
|
701
|
+
retried = true;
|
|
702
|
+
await this.git.exec(
|
|
703
|
+
{ cwd: commonPath, cancellation: cancellation },
|
|
704
|
+
'remote',
|
|
705
|
+
'set-head',
|
|
706
|
+
'-a',
|
|
707
|
+
remote,
|
|
708
|
+
);
|
|
709
|
+
continue;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
const result = await this.git.exec(
|
|
713
|
+
{ cwd: commonPath, cancellation: cancellation },
|
|
714
|
+
'ls-remote',
|
|
715
|
+
'--symref',
|
|
716
|
+
remote,
|
|
717
|
+
'HEAD',
|
|
718
|
+
);
|
|
719
|
+
if (result.stdout) {
|
|
720
|
+
const match = /ref:\s(\S+)\s+HEAD/m.exec(result.stdout);
|
|
721
|
+
if (match != null) {
|
|
722
|
+
const [, branch] = match;
|
|
723
|
+
return `${remote}/${branch.substring('refs/heads/'.length).trim()}`;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
} catch {
|
|
727
|
+
if (isCancellationError(ex)) throw ex;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
return undefined;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
@debug()
|
|
738
|
+
async createBranch(repoPath: string, name: string, ref: string, options?: { noTracking?: boolean }): Promise<void> {
|
|
739
|
+
const args = ['branch', name, ref];
|
|
740
|
+
if (options?.noTracking) {
|
|
741
|
+
args.push('--no-track');
|
|
742
|
+
}
|
|
743
|
+
try {
|
|
744
|
+
await this.git.exec({ cwd: repoPath }, ...args);
|
|
745
|
+
this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
|
|
746
|
+
this.context.hooks?.repository?.onChanged?.(repoPath, ['heads']);
|
|
747
|
+
} catch (ex) {
|
|
748
|
+
throw getGitCommandError(
|
|
749
|
+
'branch',
|
|
750
|
+
ex,
|
|
751
|
+
reason =>
|
|
752
|
+
new BranchError(
|
|
753
|
+
{
|
|
754
|
+
reason: reason ?? 'other',
|
|
755
|
+
action: 'create',
|
|
756
|
+
branch: name,
|
|
757
|
+
gitCommand: { repoPath: repoPath, args: args },
|
|
758
|
+
},
|
|
759
|
+
ex,
|
|
760
|
+
),
|
|
761
|
+
);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
@debug()
|
|
766
|
+
async deleteLocalBranch(repoPath: string, names: string | string[], options?: { force?: boolean }): Promise<void> {
|
|
767
|
+
const branches = ensureArray(names);
|
|
768
|
+
const args = ['branch', options?.force ? '-D' : '-d', ...branches];
|
|
769
|
+
try {
|
|
770
|
+
await this.git.exec({ cwd: repoPath }, ...args);
|
|
771
|
+
this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
|
|
772
|
+
this.context.hooks?.repository?.onChanged?.(repoPath, ['heads']);
|
|
773
|
+
} catch (ex) {
|
|
774
|
+
if (ex instanceof BranchError) {
|
|
775
|
+
throw ex.update({
|
|
776
|
+
action: options?.force ? 'force delete' : 'delete',
|
|
777
|
+
branch: branches.join(', '),
|
|
778
|
+
gitCommand: { repoPath: repoPath, args: args },
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
throw new BranchError(
|
|
783
|
+
{
|
|
784
|
+
action: options?.force ? 'force delete' : 'delete',
|
|
785
|
+
branch: branches.join(', '),
|
|
786
|
+
gitCommand: { repoPath: repoPath, args: args },
|
|
787
|
+
},
|
|
788
|
+
ex,
|
|
789
|
+
);
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
@debug()
|
|
794
|
+
async deleteRemoteBranch(repoPath: string, names: string | string[], remote: string): Promise<void> {
|
|
795
|
+
const branches = ensureArray(names);
|
|
796
|
+
const args = ['push', '-d', remote, ...branches];
|
|
797
|
+
try {
|
|
798
|
+
await this.git.exec({ cwd: repoPath }, ...args);
|
|
799
|
+
this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
|
|
800
|
+
this.context.hooks?.repository?.onChanged?.(repoPath, ['remotes']);
|
|
801
|
+
} catch (ex) {
|
|
802
|
+
if (ex instanceof BranchError) {
|
|
803
|
+
throw ex.update({
|
|
804
|
+
action: 'delete',
|
|
805
|
+
branch: branches.join(', '),
|
|
806
|
+
gitCommand: { repoPath: repoPath, args: args },
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
throw new BranchError(
|
|
811
|
+
{ action: 'delete', branch: branches.join(', '), gitCommand: { repoPath: repoPath, args: args } },
|
|
812
|
+
ex,
|
|
813
|
+
);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
@debug()
|
|
818
|
+
async getBranchMergedStatus(
|
|
819
|
+
repoPath: string,
|
|
820
|
+
branch: GitBranchReference,
|
|
821
|
+
into: GitBranchReference,
|
|
822
|
+
cancellation?: AbortSignal,
|
|
823
|
+
): Promise<GitBranchMergedStatus> {
|
|
824
|
+
if (branch.name === into.name || branch.upstream?.name === into.name) {
|
|
825
|
+
return { merged: false };
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
const result = await this.getBranchMergedStatusCore(repoPath, branch, into, cancellation);
|
|
829
|
+
if (result.merged) return result;
|
|
830
|
+
|
|
831
|
+
// If the branch we are checking is a remote branch, check if it has been merged into its local branch (if there is one)
|
|
832
|
+
if (into.remote) {
|
|
833
|
+
const localIntoBranch = await this.getLocalBranchByUpstream(repoPath, into.name, cancellation);
|
|
834
|
+
// If there is a local branch and it is not the branch we are checking, check if it has been merged into it
|
|
835
|
+
if (localIntoBranch != null && localIntoBranch.name !== branch.name) {
|
|
836
|
+
const result = await this.getBranchMergedStatusCore(repoPath, branch, localIntoBranch, cancellation);
|
|
837
|
+
if (result.merged) {
|
|
838
|
+
return {
|
|
839
|
+
...result,
|
|
840
|
+
localBranchOnly: createReference(localIntoBranch.ref, localIntoBranch.repoPath, {
|
|
841
|
+
id: localIntoBranch.id,
|
|
842
|
+
refType: 'branch',
|
|
843
|
+
name: localIntoBranch.name,
|
|
844
|
+
remote: localIntoBranch.remote,
|
|
845
|
+
upstream: localIntoBranch.upstream,
|
|
846
|
+
sha: localIntoBranch.sha,
|
|
847
|
+
}),
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
return { merged: false };
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
private async getBranchMergedStatusCore(
|
|
857
|
+
repoPath: string,
|
|
858
|
+
branch: GitBranchReference,
|
|
859
|
+
into: GitBranchReference,
|
|
860
|
+
cancellation?: AbortSignal,
|
|
861
|
+
): Promise<Exclude<GitBranchMergedStatus, 'localBranchOnly'>> {
|
|
862
|
+
const scope = getScopedLogger();
|
|
863
|
+
|
|
864
|
+
try {
|
|
865
|
+
// Check if branch is direct ancestor (handles FF merges)
|
|
866
|
+
try {
|
|
867
|
+
await this.git.exec(
|
|
868
|
+
{ cwd: repoPath, cancellation: cancellation, errors: 'throw' },
|
|
869
|
+
'merge-base',
|
|
870
|
+
'--is-ancestor',
|
|
871
|
+
branch.name,
|
|
872
|
+
into.name,
|
|
873
|
+
);
|
|
874
|
+
return { merged: true, confidence: 'highest' };
|
|
875
|
+
} catch (ex) {
|
|
876
|
+
if (isCancellationError(ex)) throw ex;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
// Cherry-pick detection (handles cherry-picks, rebases, etc)
|
|
880
|
+
let result = await this.git.exec(
|
|
881
|
+
{ cwd: repoPath, cancellation: cancellation },
|
|
882
|
+
'cherry',
|
|
883
|
+
'--abbrev',
|
|
884
|
+
'-v',
|
|
885
|
+
into.name,
|
|
886
|
+
branch.name,
|
|
887
|
+
);
|
|
888
|
+
// Check if there are no lines or all lines startwith a `-` (i.e. likely merged)
|
|
889
|
+
if (
|
|
890
|
+
!result.stdout ||
|
|
891
|
+
result.stdout
|
|
892
|
+
.trim()
|
|
893
|
+
.split('\n')
|
|
894
|
+
.every(l => l.startsWith('-'))
|
|
895
|
+
) {
|
|
896
|
+
return { merged: true, confidence: 'high' };
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
// Attempt to detect squash merges by checking if the diff of the branch can be cleanly removed from the target
|
|
900
|
+
const mergeBase = await this.provider.refs.getMergeBase(
|
|
901
|
+
repoPath,
|
|
902
|
+
into.name,
|
|
903
|
+
branch.name,
|
|
904
|
+
undefined,
|
|
905
|
+
cancellation,
|
|
906
|
+
);
|
|
907
|
+
result = await this.git.exec({ cwd: repoPath, cancellation: cancellation }, 'diff', mergeBase, branch.name);
|
|
908
|
+
if (result.stdout) {
|
|
909
|
+
// Create a temporary index file
|
|
910
|
+
await using disposableIndex = await this.provider.staging.createTemporaryIndex(
|
|
911
|
+
repoPath,
|
|
912
|
+
'ref',
|
|
913
|
+
into.name,
|
|
914
|
+
);
|
|
915
|
+
const { env } = disposableIndex;
|
|
916
|
+
|
|
917
|
+
result = await this.git.exec(
|
|
918
|
+
{
|
|
919
|
+
cwd: repoPath,
|
|
920
|
+
cancellation: cancellation,
|
|
921
|
+
env: env,
|
|
922
|
+
errors: 'ignore',
|
|
923
|
+
stdin: result.stdout,
|
|
924
|
+
},
|
|
925
|
+
'apply',
|
|
926
|
+
'--cached',
|
|
927
|
+
'--reverse',
|
|
928
|
+
'--check',
|
|
929
|
+
'-',
|
|
930
|
+
);
|
|
931
|
+
|
|
932
|
+
if (result.exitCode === 0 && !result.stdout.trim() && !result.stderr?.trim()) {
|
|
933
|
+
return { merged: true, confidence: 'medium' };
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
return { merged: false };
|
|
938
|
+
} catch (ex) {
|
|
939
|
+
if (Logger.enabled('trace')) {
|
|
940
|
+
scope?.error(ex);
|
|
941
|
+
}
|
|
942
|
+
if (isCancellationError(ex)) throw ex;
|
|
943
|
+
|
|
944
|
+
return { merged: false };
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
@debug()
|
|
949
|
+
async getLocalBranchByUpstream(
|
|
950
|
+
repoPath: string,
|
|
951
|
+
remoteBranchName: string,
|
|
952
|
+
cancellation?: AbortSignal,
|
|
953
|
+
): Promise<GitBranch | undefined> {
|
|
954
|
+
const branches = new PageableResult<GitBranch>(p =>
|
|
955
|
+
this.getBranches(repoPath, p != null ? { paging: p } : undefined, cancellation),
|
|
956
|
+
);
|
|
957
|
+
return getLocalBranchByUpstream(remoteBranchName, branches);
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
/** Detects potential conflicts when applying commits onto a target branch (git rebase and cherry-pick) */
|
|
961
|
+
@debug()
|
|
962
|
+
async getPotentialApplyConflicts(
|
|
963
|
+
repoPath: string,
|
|
964
|
+
targetBranch: string,
|
|
965
|
+
shas: string[],
|
|
966
|
+
options?: { stopOnFirstConflict?: boolean },
|
|
967
|
+
cancellation?: AbortSignal,
|
|
968
|
+
): Promise<ConflictDetectionResult> {
|
|
969
|
+
if (!shas.length) return { status: 'clean' };
|
|
970
|
+
|
|
971
|
+
const cacheKey: ConflictDetectionCacheKey = `apply:${targetBranch}:${shas.join(',')}:${options?.stopOnFirstConflict ?? false}`;
|
|
972
|
+
return this.cache.conflictDetection.getOrCreate(
|
|
973
|
+
repoPath,
|
|
974
|
+
cacheKey,
|
|
975
|
+
async (_cacheable, signal) => {
|
|
976
|
+
// Resolve all parent refs in a single call - fails if any commit is a root commit (no parent)
|
|
977
|
+
const parentRefs = shas.map(c => `${c}^`);
|
|
978
|
+
let parentShas: string[];
|
|
979
|
+
try {
|
|
980
|
+
const result = await this.git.exec(
|
|
981
|
+
{ cwd: repoPath, cancellation: signal, errors: 'throw' },
|
|
982
|
+
'rev-parse',
|
|
983
|
+
...parentRefs,
|
|
984
|
+
);
|
|
985
|
+
parentShas = result.stdout.trim().split('\n');
|
|
986
|
+
} catch (ex) {
|
|
987
|
+
if (isCancellationError(ex)) throw ex;
|
|
988
|
+
// If any commit doesn't have a parent (root commit), we can't do conflict detection
|
|
989
|
+
return createConflictDetectionError('noParent');
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
if (parentShas.length !== shas.length) {
|
|
993
|
+
return createConflictDetectionError('refNotFound');
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
const commitsWithParents = shas.map((c, i) => ({ sha: c, parent: parentShas[i] }));
|
|
997
|
+
return this.checkForPotentialConflicts(repoPath, commitsWithParents, targetBranch, signal, options);
|
|
998
|
+
},
|
|
999
|
+
{ cancellation: cancellation },
|
|
1000
|
+
);
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/** Detects potential conflict when merge a branch into a target branch (git merge) */
|
|
1004
|
+
@debug()
|
|
1005
|
+
async getPotentialMergeConflicts(
|
|
1006
|
+
repoPath: string,
|
|
1007
|
+
branch: string,
|
|
1008
|
+
targetBranch: string,
|
|
1009
|
+
cancellation?: AbortSignal,
|
|
1010
|
+
): Promise<ConflictDetectionResult> {
|
|
1011
|
+
const scope = getScopedLogger();
|
|
1012
|
+
|
|
1013
|
+
const cacheKey: ConflictDetectionCacheKey = `merge:${branch}:${targetBranch}`;
|
|
1014
|
+
return this.cache.conflictDetection.getOrCreate(
|
|
1015
|
+
repoPath,
|
|
1016
|
+
cacheKey,
|
|
1017
|
+
async (_cacheable, signal) => {
|
|
1018
|
+
// Requires Git v2.33+
|
|
1019
|
+
if (!(await this.git.supports('git:merge-tree'))) {
|
|
1020
|
+
return createConflictDetectionError('unsupported');
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
let data;
|
|
1024
|
+
try {
|
|
1025
|
+
const result = await this.git.exec(
|
|
1026
|
+
{ cwd: repoPath, cancellation: signal, errors: 'throw' },
|
|
1027
|
+
'merge-tree',
|
|
1028
|
+
'-z',
|
|
1029
|
+
'--name-only',
|
|
1030
|
+
'--no-messages',
|
|
1031
|
+
branch,
|
|
1032
|
+
targetBranch,
|
|
1033
|
+
);
|
|
1034
|
+
data = result.stdout;
|
|
1035
|
+
} catch (ex) {
|
|
1036
|
+
if (isCancellationError(ex)) throw ex;
|
|
1037
|
+
|
|
1038
|
+
const msg: string = ex?.toString() ?? '';
|
|
1039
|
+
if (GitErrors.notAValidObjectName.test(msg)) {
|
|
1040
|
+
scope?.error(
|
|
1041
|
+
ex,
|
|
1042
|
+
`'${targetBranch}' or '${branch}' not found - ensure the branches exist and are fully qualified (e.g. 'refs/heads/main')`,
|
|
1043
|
+
);
|
|
1044
|
+
return createConflictDetectionError('refNotFound');
|
|
1045
|
+
} else if (GitErrors.badRevision.test(msg)) {
|
|
1046
|
+
scope?.error(ex, `Invalid branch name: ${msg.slice(msg.indexOf("'"))}`);
|
|
1047
|
+
return createConflictDetectionError('refNotFound');
|
|
1048
|
+
} else if (GitErrors.noMergeBase.test(msg)) {
|
|
1049
|
+
scope?.error(
|
|
1050
|
+
ex,
|
|
1051
|
+
`Unable to merge '${branch}' and '${targetBranch}' as they have no common ancestor`,
|
|
1052
|
+
);
|
|
1053
|
+
return createConflictDetectionError('noMergeBase');
|
|
1054
|
+
} else if (ex instanceof GitError) {
|
|
1055
|
+
data = ex.stdout;
|
|
1056
|
+
} else {
|
|
1057
|
+
scope?.error(ex);
|
|
1058
|
+
return createConflictDetectionError('other');
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
if (!data) return { status: 'clean' };
|
|
1062
|
+
|
|
1063
|
+
const mergeConflict = parseMergeTreeConflict(data);
|
|
1064
|
+
if (!mergeConflict.conflicts.length) return { status: 'clean' };
|
|
1065
|
+
|
|
1066
|
+
return {
|
|
1067
|
+
status: 'conflicts',
|
|
1068
|
+
conflict: {
|
|
1069
|
+
repoPath: repoPath,
|
|
1070
|
+
branch: branch,
|
|
1071
|
+
target: targetBranch,
|
|
1072
|
+
files: mergeConflict.conflicts,
|
|
1073
|
+
shas: undefined, // Merge conflicts don't have a specific commit SHA
|
|
1074
|
+
},
|
|
1075
|
+
};
|
|
1076
|
+
},
|
|
1077
|
+
{ cancellation: cancellation },
|
|
1078
|
+
);
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
private async checkForPotentialConflicts(
|
|
1082
|
+
repoPath: string,
|
|
1083
|
+
commits: Iterable<{ sha: string; parent: string }>,
|
|
1084
|
+
targetBranch: string,
|
|
1085
|
+
cancellation?: AbortSignal,
|
|
1086
|
+
options?: { stopOnFirstConflict?: boolean },
|
|
1087
|
+
): Promise<ConflictDetectionResult> {
|
|
1088
|
+
const scope = getScopedLogger();
|
|
1089
|
+
|
|
1090
|
+
// Requires Git v2.38+ for --write-tree with 3-arg form
|
|
1091
|
+
if (!(await this.git.supports('git:merge-tree:write-tree'))) {
|
|
1092
|
+
return createConflictDetectionError('unsupported');
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
let currentTreeOid: string;
|
|
1096
|
+
try {
|
|
1097
|
+
// Get the initial target branch tree OID
|
|
1098
|
+
const treeResult = await this.git.exec(
|
|
1099
|
+
{ cwd: repoPath, cancellation: cancellation, errors: 'throw' },
|
|
1100
|
+
'rev-parse',
|
|
1101
|
+
`${targetBranch}^{tree}`,
|
|
1102
|
+
);
|
|
1103
|
+
currentTreeOid = treeResult.stdout.trim();
|
|
1104
|
+
} catch (ex) {
|
|
1105
|
+
if (isCancellationError(ex)) throw ex;
|
|
1106
|
+
scope?.error(ex, `Failed to resolve target branch '${targetBranch}'`);
|
|
1107
|
+
return createConflictDetectionError('refNotFound');
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
const conflictingShas: string[] = [];
|
|
1111
|
+
const conflictingFilePaths = new Set<string>();
|
|
1112
|
+
|
|
1113
|
+
for (const commit of commits) {
|
|
1114
|
+
if (cancellation?.aborted) throw new CancellationError();
|
|
1115
|
+
|
|
1116
|
+
let data;
|
|
1117
|
+
try {
|
|
1118
|
+
// Use merge-tree --write-tree with --merge-base to simulate cherry-pick:
|
|
1119
|
+
// merge-tree --write-tree --merge-base=<commit-parent> <current-tree> <commit>
|
|
1120
|
+
// This performs a 3-way merge where:
|
|
1121
|
+
// - base = commit.parent (where the commit started)
|
|
1122
|
+
// - ours = currentTreeOid (current state of the target)
|
|
1123
|
+
// - theirs = commit.sha (what we're cherry-picking)
|
|
1124
|
+
const result = await this.git.exec(
|
|
1125
|
+
{ cwd: repoPath, cancellation: cancellation, errors: 'throw' },
|
|
1126
|
+
'merge-tree',
|
|
1127
|
+
'--write-tree',
|
|
1128
|
+
'-z',
|
|
1129
|
+
'--name-only',
|
|
1130
|
+
'--no-messages',
|
|
1131
|
+
`--merge-base=${commit.parent}`,
|
|
1132
|
+
currentTreeOid,
|
|
1133
|
+
commit.sha,
|
|
1134
|
+
);
|
|
1135
|
+
data = result.stdout;
|
|
1136
|
+
} catch (ex) {
|
|
1137
|
+
if (isCancellationError(ex)) throw ex;
|
|
1138
|
+
|
|
1139
|
+
const msg: string = ex?.toString() ?? '';
|
|
1140
|
+
if (GitErrors.notAValidObjectName.test(msg)) {
|
|
1141
|
+
scope?.error(
|
|
1142
|
+
ex,
|
|
1143
|
+
`'${targetBranch}' or '${commit.sha}' not found - ensure the branches/commits exist`,
|
|
1144
|
+
);
|
|
1145
|
+
return createConflictDetectionError('refNotFound');
|
|
1146
|
+
} else if (GitErrors.badRevision.test(msg)) {
|
|
1147
|
+
scope?.error(ex, `Invalid revision: ${msg.slice(msg.indexOf("'"))}`);
|
|
1148
|
+
return createConflictDetectionError('refNotFound');
|
|
1149
|
+
} else if (GitErrors.noMergeBase.test(msg)) {
|
|
1150
|
+
scope?.error(
|
|
1151
|
+
ex,
|
|
1152
|
+
`Unable to merge '${commit.sha}' and '${targetBranch}' as they have no common ancestor`,
|
|
1153
|
+
);
|
|
1154
|
+
return createConflictDetectionError('noMergeBase');
|
|
1155
|
+
} else if (ex instanceof GitError) {
|
|
1156
|
+
data = ex.stdout;
|
|
1157
|
+
} else {
|
|
1158
|
+
scope?.error(ex, 'Failed to execute merge-tree for conflict check');
|
|
1159
|
+
return createConflictDetectionError('other');
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
if (!data) continue;
|
|
1164
|
+
|
|
1165
|
+
const mergeConflict = parseMergeTreeConflict(data);
|
|
1166
|
+
|
|
1167
|
+
if (mergeConflict.conflicts.length) {
|
|
1168
|
+
conflictingShas.push(commit.sha);
|
|
1169
|
+
for (const file of mergeConflict.conflicts) {
|
|
1170
|
+
conflictingFilePaths.add(file.path);
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
if (options?.stopOnFirstConflict) {
|
|
1174
|
+
return {
|
|
1175
|
+
status: 'conflicts',
|
|
1176
|
+
conflict: {
|
|
1177
|
+
repoPath: repoPath,
|
|
1178
|
+
branch: commit.sha,
|
|
1179
|
+
target: targetBranch,
|
|
1180
|
+
files: mergeConflict.conflicts,
|
|
1181
|
+
shas: [commit.sha],
|
|
1182
|
+
},
|
|
1183
|
+
stoppedOnFirstConflict: true,
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
// Update currentTreeOid to the result tree OID for the next iteration
|
|
1189
|
+
// This works even when there are conflicts - the tree contains conflict markers
|
|
1190
|
+
if (mergeConflict.treeOid) {
|
|
1191
|
+
currentTreeOid = mergeConflict.treeOid;
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
if (conflictingShas.length) {
|
|
1196
|
+
return {
|
|
1197
|
+
status: 'conflicts',
|
|
1198
|
+
conflict: {
|
|
1199
|
+
repoPath: repoPath,
|
|
1200
|
+
branch: conflictingShas[0],
|
|
1201
|
+
target: targetBranch,
|
|
1202
|
+
files: Array.from(conflictingFilePaths, path => ({ path: path })),
|
|
1203
|
+
shas: conflictingShas,
|
|
1204
|
+
},
|
|
1205
|
+
stoppedOnFirstConflict: false,
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
return { status: 'clean' };
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
@debug({ exit: true })
|
|
1213
|
+
async getBaseBranchName(repoPath: string, ref: string, cancellation?: AbortSignal): Promise<string | undefined> {
|
|
1214
|
+
try {
|
|
1215
|
+
// getGkConfig has built-in fallback to regular config for backward compatibility
|
|
1216
|
+
let mergeBase = await this.provider.config.getGkConfig(repoPath, `branch.${ref}.gk-merge-base`);
|
|
1217
|
+
let update = false;
|
|
1218
|
+
|
|
1219
|
+
// Also check vscode-merge-base in regular config (VS Code compatibility)
|
|
1220
|
+
if (mergeBase == null) {
|
|
1221
|
+
mergeBase = await this.provider.config.getConfig(repoPath, `branch.${ref}.vscode-merge-base`);
|
|
1222
|
+
update = mergeBase != null;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
if (mergeBase != null) {
|
|
1226
|
+
const branch = await this.provider.refs.getSymbolicReferenceName(repoPath, mergeBase);
|
|
1227
|
+
if (branch != null) {
|
|
1228
|
+
if (update) {
|
|
1229
|
+
void this.storeBaseBranchName(repoPath, ref, branch);
|
|
1230
|
+
}
|
|
1231
|
+
return branch;
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
} catch {}
|
|
1235
|
+
|
|
1236
|
+
const branch = await this.getBaseBranchFromReflog(repoPath, ref, { upstream: true }, cancellation);
|
|
1237
|
+
if (branch != null) {
|
|
1238
|
+
void this.storeBaseBranchName(repoPath, ref, branch);
|
|
1239
|
+
return branch;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
return undefined;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
private async getBaseBranchFromReflog(
|
|
1246
|
+
repoPath: string,
|
|
1247
|
+
ref: string,
|
|
1248
|
+
options?: { upstream: true },
|
|
1249
|
+
cancellation?: AbortSignal,
|
|
1250
|
+
): Promise<string | undefined> {
|
|
1251
|
+
try {
|
|
1252
|
+
let result = await this.git.exec(
|
|
1253
|
+
{ cwd: repoPath, cancellation: cancellation },
|
|
1254
|
+
'reflog',
|
|
1255
|
+
ref,
|
|
1256
|
+
'--grep-reflog=branch: Created from *.',
|
|
1257
|
+
);
|
|
1258
|
+
|
|
1259
|
+
let entries = result.stdout.split('\n').filter(entry => Boolean(entry));
|
|
1260
|
+
if (entries.length !== 1) return undefined;
|
|
1261
|
+
|
|
1262
|
+
// Check if branch created from an explicit branch
|
|
1263
|
+
let match = entries[0].match(/branch: Created from (.*)$/);
|
|
1264
|
+
if (match?.length === 2) {
|
|
1265
|
+
let name: string | undefined = match[1];
|
|
1266
|
+
if (name !== 'HEAD') {
|
|
1267
|
+
if (options?.upstream) {
|
|
1268
|
+
const upstream = await this.provider.refs.getSymbolicReferenceName(repoPath, `${name}@{u}`);
|
|
1269
|
+
if (upstream) return upstream;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
name = await this.provider.refs.getSymbolicReferenceName(repoPath, name);
|
|
1273
|
+
if (name) return name;
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
// Check if branch was created from HEAD
|
|
1278
|
+
result = await this.git.exec(
|
|
1279
|
+
{ cwd: repoPath, cancellation: cancellation },
|
|
1280
|
+
'reflog',
|
|
1281
|
+
'HEAD',
|
|
1282
|
+
`--grep-reflog=checkout: moving from .* to ${ref.replace('refs/heads/', '')}`,
|
|
1283
|
+
);
|
|
1284
|
+
|
|
1285
|
+
entries = result.stdout.split('\n').filter(entry => Boolean(entry));
|
|
1286
|
+
if (!entries.length) return undefined;
|
|
1287
|
+
|
|
1288
|
+
match = entries.at(-1)!.match(/checkout: moving from ([^\s]+)\s/);
|
|
1289
|
+
if (match?.length === 2) {
|
|
1290
|
+
let name: string | undefined = match[1];
|
|
1291
|
+
if (options?.upstream) {
|
|
1292
|
+
const upstream = await this.provider.refs.getSymbolicReferenceName(repoPath, `${name}@{u}`);
|
|
1293
|
+
if (upstream) return upstream;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
name = await this.provider.refs.getSymbolicReferenceName(repoPath, name);
|
|
1297
|
+
if (name) return name;
|
|
1298
|
+
}
|
|
1299
|
+
} catch (ex) {
|
|
1300
|
+
if (isCancellationError(ex)) throw ex;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
return undefined;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
@debug({ exit: true })
|
|
1307
|
+
async getStoredMergeTargetBranchName(repoPath: string, ref: string): Promise<string | undefined> {
|
|
1308
|
+
const target =
|
|
1309
|
+
(await this.getStoredUserMergeTargetBranchName?.(repoPath, ref)) ??
|
|
1310
|
+
(await this.getStoredDetectedMergeTargetBranchName?.(repoPath, ref));
|
|
1311
|
+
return target?.trim() || undefined;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
@debug({ exit: true })
|
|
1315
|
+
async getStoredDetectedMergeTargetBranchName(repoPath: string, ref: string): Promise<string | undefined> {
|
|
1316
|
+
const target =
|
|
1317
|
+
(await this.provider.config.getGkConfig(repoPath, `branch.${ref}.gk-merge-target`)) ??
|
|
1318
|
+
(await this.provider.config.getGkConfig(repoPath, `branch.${ref}.gk-target-base`)); // legacy key
|
|
1319
|
+
return target?.trim() || undefined;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
@debug()
|
|
1323
|
+
async getStoredUserMergeTargetBranchName(repoPath: string, ref: string): Promise<string | undefined> {
|
|
1324
|
+
const target = await this.provider.config.getGkConfig(repoPath, `branch.${ref}.gk-merge-target-user`);
|
|
1325
|
+
return target?.trim() || undefined;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
/** Updates the last accessed timestamp for the current branch */
|
|
1329
|
+
@debounce(2.5 * 60 * 1000)
|
|
1330
|
+
@debug()
|
|
1331
|
+
async onCurrentBranchAccessed(repoPath: string): Promise<void> {
|
|
1332
|
+
const branch = await this.getBranch(repoPath);
|
|
1333
|
+
if (branch == null || branch.remote || branch.detached) return;
|
|
1334
|
+
|
|
1335
|
+
await this.storeBranchMetadata(repoPath, 'gk-last-accessed', branch.name, new Date());
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
/** Updates the last accessed and modified timestamp for the current branch */
|
|
1339
|
+
@debounce(2.5 * 60 * 1000)
|
|
1340
|
+
@debug()
|
|
1341
|
+
async onCurrentBranchModified(repoPath: string): Promise<void> {
|
|
1342
|
+
const branch = await this.getBranch(repoPath);
|
|
1343
|
+
if (branch == null || branch.remote || branch.detached) return;
|
|
1344
|
+
|
|
1345
|
+
const now = new Date();
|
|
1346
|
+
await this.storeBranchMetadata(repoPath, 'gk-last-accessed', branch.name, now);
|
|
1347
|
+
await this.storeBranchMetadata(repoPath, 'gk-last-modified', branch.name, now);
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
@debug()
|
|
1351
|
+
async renameBranch(repoPath: string, oldName: string, newName: string): Promise<void> {
|
|
1352
|
+
const args = ['branch', '-m', oldName, newName];
|
|
1353
|
+
try {
|
|
1354
|
+
await this.git.exec({ cwd: repoPath }, ...args);
|
|
1355
|
+
this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
|
|
1356
|
+
this.context.hooks?.repository?.onChanged?.(repoPath, ['heads']);
|
|
1357
|
+
} catch (ex) {
|
|
1358
|
+
throw getGitCommandError(
|
|
1359
|
+
'branch',
|
|
1360
|
+
ex,
|
|
1361
|
+
reason =>
|
|
1362
|
+
new BranchError(
|
|
1363
|
+
{
|
|
1364
|
+
reason: reason ?? 'other',
|
|
1365
|
+
action: 'rename',
|
|
1366
|
+
branch: oldName,
|
|
1367
|
+
gitCommand: { repoPath: repoPath, args: args },
|
|
1368
|
+
},
|
|
1369
|
+
ex,
|
|
1370
|
+
),
|
|
1371
|
+
);
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
@debug()
|
|
1376
|
+
async setUpstreamBranch(repoPath: string, name: string, upstream: string | undefined): Promise<void> {
|
|
1377
|
+
const args =
|
|
1378
|
+
upstream == null ? ['branch', '--unset-upstream', name] : ['branch', '--set-upstream-to', upstream, name];
|
|
1379
|
+
try {
|
|
1380
|
+
await this.git.exec({ cwd: repoPath }, ...args);
|
|
1381
|
+
this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
|
|
1382
|
+
this.context.hooks?.repository?.onChanged?.(repoPath, ['heads']);
|
|
1383
|
+
} catch (ex) {
|
|
1384
|
+
throw getGitCommandError(
|
|
1385
|
+
'branch',
|
|
1386
|
+
ex,
|
|
1387
|
+
reason =>
|
|
1388
|
+
new BranchError(
|
|
1389
|
+
{
|
|
1390
|
+
reason: reason ?? 'other',
|
|
1391
|
+
action: upstream == null ? 'unset upstream of' : `set upstream to '${upstream}' for`,
|
|
1392
|
+
branch: name,
|
|
1393
|
+
gitCommand: { repoPath: repoPath, args: args },
|
|
1394
|
+
},
|
|
1395
|
+
ex,
|
|
1396
|
+
),
|
|
1397
|
+
);
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
@debug()
|
|
1402
|
+
async storeBaseBranchName(repoPath: string, ref: string, base: string): Promise<void> {
|
|
1403
|
+
await this.provider.config.setGkConfig(repoPath, `branch.${ref}.gk-merge-base`, base);
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
@debug()
|
|
1407
|
+
async storeMergeTargetBranchName(repoPath: string, ref: string, target: string): Promise<void> {
|
|
1408
|
+
await this.provider.config.setGkConfig(repoPath, `branch.${ref}.gk-merge-target`, target);
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
@debug()
|
|
1412
|
+
async storeUserMergeTargetBranchName(repoPath: string, ref: string, target: string | undefined): Promise<void> {
|
|
1413
|
+
await this.provider.config.setGkConfig(repoPath, `branch.${ref}.gk-merge-target-user`, target);
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
/**
|
|
1417
|
+
* Gets all branch metadata (dates and disposition) from git config in a single batch operation.
|
|
1418
|
+
* @returns A map of branch name to metadata.
|
|
1419
|
+
*/
|
|
1420
|
+
private async getBranchMetadataMap(repoPath: string): Promise<Map<string, BranchMetadata>> {
|
|
1421
|
+
const scope = getScopedLogger();
|
|
1422
|
+
const metadataMap = new Map<string, BranchMetadata>();
|
|
1423
|
+
|
|
1424
|
+
try {
|
|
1425
|
+
// Use git config --get-regexp to load all gk-* branch metadata in one call
|
|
1426
|
+
const configMap = await this.provider.config.getGkConfigRegex(
|
|
1427
|
+
repoPath,
|
|
1428
|
+
'^branch\\..*\\.gk-(last-(accessed|modified)|disposition)$',
|
|
1429
|
+
);
|
|
1430
|
+
if (!configMap.size) return metadataMap;
|
|
1431
|
+
|
|
1432
|
+
for (const [key, value] of configMap) {
|
|
1433
|
+
// Extract branch name and metadata key from "branch.{name}.gk-{key}"
|
|
1434
|
+
if (!key.startsWith('branch.')) continue;
|
|
1435
|
+
|
|
1436
|
+
const keyParts = key.split('.');
|
|
1437
|
+
if (keyParts.length < 3) continue;
|
|
1438
|
+
|
|
1439
|
+
// Branch name is everything between "branch." and the last ".gk-*"
|
|
1440
|
+
const metaKey = keyParts.at(-1);
|
|
1441
|
+
const branchName = keyParts.slice(1, -1).join('.');
|
|
1442
|
+
|
|
1443
|
+
let metadata = metadataMap.get(branchName);
|
|
1444
|
+
if (metadata == null) {
|
|
1445
|
+
metadata = {};
|
|
1446
|
+
metadataMap.set(branchName, metadata);
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
if (metaKey === 'gk-last-accessed') {
|
|
1450
|
+
metadata.lastAccessedAt = value;
|
|
1451
|
+
} else if (metaKey === 'gk-last-modified') {
|
|
1452
|
+
metadata.lastModifiedAt = value;
|
|
1453
|
+
} else if (metaKey === 'gk-disposition') {
|
|
1454
|
+
if (value === 'starred' || value === 'archived') {
|
|
1455
|
+
metadata.disposition = value;
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
} catch (ex) {
|
|
1460
|
+
debugger;
|
|
1461
|
+
scope?.error(ex);
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
return metadataMap;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
private async storeBranchMetadata(
|
|
1468
|
+
repoPath: string,
|
|
1469
|
+
key: 'gk-last-accessed' | 'gk-last-modified',
|
|
1470
|
+
ref: string,
|
|
1471
|
+
date: Date,
|
|
1472
|
+
): Promise<void> {
|
|
1473
|
+
const value = await this.provider.config.getGkConfig(repoPath, `branch.${ref}.${key}`);
|
|
1474
|
+
// Skip if incoming date is not at least 5 minutes newer than stored date
|
|
1475
|
+
if (value != null && date.getTime() - new Date(value).getTime() < dateMetadataStaleThresholdMs) {
|
|
1476
|
+
return;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
return this.provider.config.setGkConfig(repoPath, `branch.${ref}.${key}`, date.toISOString());
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
async setBranchDisposition(
|
|
1483
|
+
repoPath: string,
|
|
1484
|
+
branchName: string,
|
|
1485
|
+
disposition: BranchDisposition | undefined,
|
|
1486
|
+
): Promise<void> {
|
|
1487
|
+
await this.provider.config.setGkConfig(repoPath, `branch.${branchName}.gk-disposition`, disposition);
|
|
1488
|
+
this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
|
|
1489
|
+
this.context.hooks?.repository?.onChanged?.(repoPath, ['starred']);
|
|
1490
|
+
}
|
|
1491
|
+
}
|