mirror of
https://github.com/Microsoft/vscode
synced 2024-10-04 10:27:46 +00:00
git: sync action
This commit is contained in:
parent
c0ef3e4880
commit
87eea6cdcc
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue