提交 87eea6cd 编写于 作者: J Joao Moreno

git: sync action

上级 c0ef3e48
......@@ -98,6 +98,11 @@
"command": "git.publish",
"title": "Publish",
"category": "Git"
},
{
"command": "git.sync",
"title": "Sync",
"category": "Git"
}
],
"menus": {
......
......@@ -91,6 +91,7 @@ class CommandCenter {
commands.registerCommand('git.clean', this.clean, this),
commands.registerCommand('git.cleanAll', this.cleanAll, this),
commands.registerCommand('git.checkout', this.checkout, this),
commands.registerCommand('git.sync', this.sync, this),
commands.registerCommand('git.publish', this.publish, this),
);
}
......@@ -204,6 +205,11 @@ class CommandCenter {
await choice.run(this.model);
}
@decorate(catchErrors)
async sync(): Promise<void> {
await this.model.sync();
}
@decorate(catchErrors)
async publish(): Promise<void> {
const branchName = this.model.HEAD && this.model.HEAD.name || '';
......
......@@ -327,6 +327,11 @@ export class Model {
await this.update();
}
async sync(): Promise<void> {
await this.repository.sync();
await this.update();
}
async push(remote?: string, name?: string, options?: IPushOptions): Promise<void> {
await this.repository.push(remote, name, options);
await this.update();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册