提交 2f57095b 编写于 作者: J João Moreno 提交者: GitHub

Merge pull request #29264 from Krzysztof-Cieslak/commit_amend

Add Git commit amend commands
......@@ -152,6 +152,11 @@
"title": "%command.commitStagedSigned%",
"category": "Git"
},
{
"command": "git.commitStagedAmend",
"title": "%command.commitStagedAmend%",
"category": "Git"
},
{
"command": "git.commitAll",
"title": "%command.commitAll%",
......@@ -162,6 +167,11 @@
"title": "%command.commitAllSigned%",
"category": "Git"
},
{
"command": "git.commitAllAmend",
"title": "%command.commitAllAmend%",
"category": "Git"
},
{
"command": "git.undoCommit",
"title": "%command.undoCommit%",
......@@ -317,6 +327,10 @@
"command": "git.commitStagedSigned",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.commitStagedAmend",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.commitAll",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
......@@ -325,6 +339,10 @@
"command": "git.commitAllSigned",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.commitAllAmend",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.undoCommit",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
......@@ -446,6 +464,11 @@
"group": "3_commit",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.commitStagedAmend",
"group": "3_commit",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.commitAll",
"group": "3_commit",
......@@ -456,6 +479,11 @@
"group": "3_commit",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.commitAllAmend",
"group": "3_commit",
"when": "config.git.enabled && scmProvider == git && gitState == idle"
},
{
"command": "git.undoCommit",
"group": "3_commit",
......
......@@ -17,8 +17,10 @@
"command.commit": "Commit",
"command.commitStaged": "Commit Staged",
"command.commitStagedSigned": "Commit Staged (Signed Off)",
"command.commitStagedAmend": "Commit Staged (Amend)",
"command.commitAll": "Commit All",
"command.commitAllSigned": "Commit All (Signed Off)",
"command.commitAllAmend": "Commit All (Amend)",
"command.undoCommit": "Undo Last Commit",
"command.checkout": "Checkout to...",
"command.branch": "Create Branch...",
......
......@@ -734,6 +734,11 @@ export class CommandCenter {
await this.commitWithAnyInput({ all: false, signoff: true });
}
@command('git.commitStagedAmend')
async commitStagedAmend(): Promise<void> {
await this.commitWithAnyInput({ all: false, amend: true });
}
@command('git.commitAll')
async commitAll(): Promise<void> {
await this.commitWithAnyInput({ all: true });
......@@ -744,6 +749,11 @@ export class CommandCenter {
await this.commitWithAnyInput({ all: true, signoff: true });
}
@command('git.commitAllAmend')
async commitAllAmend(): Promise<void> {
await this.commitWithAnyInput({ all: true, amend: true });
}
@command('git.undoCommit')
async undoCommit(): Promise<void> {
const HEAD = this.model.HEAD;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册