Browse Source

Adds Open Git Worktree command

main
Eric Amodio 1 year ago
parent
commit
1fd62bda1e
4 changed files with 15 additions and 0 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +9
    -0
      package.json
  3. +4
    -0
      src/commands/gitCommands.ts
  4. +1
    -0
      src/constants.ts

+ 1
- 0
CHANGELOG.md View File

@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Added
- Adds an experimental _Generate Commit Message (Experimental)_ command to use OpenAI to generate a commit message for staged changes — currently only available in the pre-release edition
- Adds a _Open Git Worktree..._ command to jump directly to opening a worktree in the _Git Command Palette_
### Fixed

+ 9
- 0
package.json View File

@ -4953,6 +4953,11 @@
"category": "GitLens+"
},
{
"command": "gitlens.gitCommands.worktree.open",
"title": "Open Git Worktree...",
"category": "GitLens+"
},
{
"command": "gitlens.switchMode",
"title": "Switch Mode",
"category": "GitLens"
@ -7737,6 +7742,10 @@
"when": "!gitlens:disabled && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders"
},
{
"command": "gitlens.gitCommands.worktree.open",
"when": "!gitlens:disabled && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders"
},
{
"command": "gitlens.switchMode",
"when": "gitlens:enabled"
},

+ 4
- 0
src/commands/gitCommands.ts View File

@ -82,6 +82,7 @@ export class GitCommandsCommand extends Command {
Commands.GitCommandsSwitch,
Commands.GitCommandsTag,
Commands.GitCommandsWorktree,
Commands.GitCommandsWorktreeOpen,
]);
}
@ -114,6 +115,9 @@ export class GitCommandsCommand extends Command {
case Commands.GitCommandsWorktree:
args = { command: 'worktree' };
break;
case Commands.GitCommandsWorktreeOpen:
args = { command: 'worktree', state: { subcommand: 'open' } };
break;
}
return this.execute(args);

+ 1
- 0
src/constants.ts View File

@ -172,6 +172,7 @@ export const enum Commands {
GitCommandsSwitch = 'gitlens.gitCommands.switch',
GitCommandsTag = 'gitlens.gitCommands.tag',
GitCommandsWorktree = 'gitlens.gitCommands.worktree',
GitCommandsWorktreeOpen = 'gitlens.gitCommands.worktree.open',
OpenOrCreateWorktreeForGHPR = 'gitlens.ghpr.views.openOrCreateWorktree',
PlusHide = 'gitlens.plus.hide',
PlusLearn = 'gitlens.plus.learn',

Loading…
Cancel
Save