Git - add actions to merge/rebase to repositories view (#274480)

This commit is contained in:
Ladislau Szomoru
2025-11-01 08:08:31 +00:00
committed by GitHub
parent 6c86512615
commit c0755c9484
3 changed files with 51 additions and 1 deletions

View File

@@ -1059,6 +1059,18 @@
"icon": "$(plus)",
"category": "Git",
"enablement": "!operationInProgress"
},
{
"command": "git.repositories.merge",
"title": "%command.merge2%",
"category": "Git",
"enablement": "!operationInProgress"
},
{
"command": "git.repositories.rebase",
"title": "%command.rebase2%",
"category": "Git",
"enablement": "!operationInProgress"
}
],
"continueEditSession": [
@@ -1702,6 +1714,14 @@
{
"command": "git.repositories.createTag",
"when": "false"
},
{
"command": "git.repositories.merge",
"when": "false"
},
{
"command": "git.repositories.rebase",
"when": "false"
}
],
"scm/title": [
@@ -1920,9 +1940,19 @@
"group": "1_checkout@2",
"when": "scmProvider == git"
},
{
"command": "git.repositories.merge",
"group": "2_modify@1",
"when": "scmProvider == git && scmArtifactGroupId == branches"
},
{
"command": "git.repositories.rebase",
"group": "2_modify@2",
"when": "scmProvider == git && scmArtifactGroupId == branches"
},
{
"command": "git.repositories.compareRef",
"group": "2_compare@1",
"group": "3_compare@1",
"when": "scmProvider == git"
}
],

View File

@@ -74,8 +74,10 @@
"command.cherryPick": "Cherry Pick...",
"command.cherryPickAbort": "Abort Cherry Pick",
"command.merge": "Merge...",
"command.merge2": "Merge",
"command.mergeAbort": "Abort Merge",
"command.rebase": "Rebase Branch...",
"command.rebase2": "Rebase Branch",
"command.createTag": "Create Tag...",
"command.deleteTag": "Delete Tag...",
"command.migrateWorktreeChanges": "Migrate Worktree Changes...",

View File

@@ -5278,6 +5278,24 @@ export class CommandCenter {
await this._checkout(repository, { treeish: artifact.name, detached: true });
}
@command('git.repositories.merge', { repository: true })
async artifactMerge(repository: Repository, artifact: SourceControlArtifact): Promise<void> {
if (!repository || !artifact) {
return;
}
await repository.merge(artifact.id);
}
@command('git.repositories.rebase', { repository: true })
async artifactRebase(repository: Repository, artifact: SourceControlArtifact): Promise<void> {
if (!repository || !artifact) {
return;
}
await repository.rebase(artifact.id);
}
@command('git.repositories.compareRef', { repository: true })
async artifactCompareWith(repository: Repository, artifact: SourceControlArtifact): Promise<void> {
if (!repository || !artifact) {