提交 16694c32 编写于 作者: J Joao Moreno

git: add commit toolbar menu item

上级 cc8351eb
......@@ -97,7 +97,11 @@
{
"command": "git.commit",
"title": "%command.commit%",
"category": "Git"
"category": "Git",
"icon": {
"light": "resources/icons/light/check.svg",
"dark": "resources/icons/dark/check.svg"
}
},
{
"command": "git.commitStaged",
......@@ -180,6 +184,11 @@
],
"menus": {
"scm/title": [
{
"command": "git.commit",
"group": "navigation",
"when": "scmProvider == git"
},
{
"command": "git.refresh",
"group": "navigation",
......
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="-2 -2 16 16" enable-background="new -2 -2 16 16"><polygon fill="#C5C5C5" points="9,0 4.5,9 3,6 0,6 3,12 6,12 12,0"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><polygon points="5.382,13 2.382,7 6.618,7 7,7.764 9.382,3 13.618,3 8.618,13" fill="#F6F6F6"/><path d="M12 4l-4 8h-2l-2-4h2l1 2 3-6h2z" fill="#424242"/></svg>
\ No newline at end of file
......@@ -331,10 +331,22 @@ export class CommandCenter {
@CommandCenter.Command('git.commit')
@CommandCenter.CatchErrors
async commit(): Promise<void> {
await this._commit(async () => await window.showInputBox({
placeHolder: localize('commit message', "Commit message"),
prompt: localize('provide commit message', "Please provide a commit message")
}));
const message = this.commitController.message;
const didCommit = await this._commit(async () => {
if (message) {
return message;
}
return await window.showInputBox({
placeHolder: localize('commit message', "Commit message"),
prompt: localize('provide commit message', "Please provide a commit message")
});
});
if (message && didCommit) {
this.commitController.message = '';
}
}
@CommandCenter.Command('git.commitWithInput')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册