提交 49bc06dd 编写于 作者: J Joao Moreno

🐛 git: don't push on sync if unnecessary

上级 48900d65
......@@ -720,11 +720,6 @@ export class Repository {
}
}
async sync(): Promise<void> {
await this.pull();
await this.push();
}
async getStatus(): Promise<IFileStatus[]> {
const executionResult = await this.run(['status', '-z', '-u']);
const status = executionResult.stdout;
......
......@@ -498,7 +498,15 @@ export class Model implements Disposable {
@throttle
async sync(): Promise<void> {
await this.run(Operation.Sync, () => this.repository.sync());
await this.run(Operation.Sync, async () => {
await this.repository.pull();
const shouldPush = this.HEAD ? this.HEAD.ahead > 0 : true;
if (shouldPush) {
await this.repository.push();
}
});
}
async show(ref: string, uri: Uri): Promise<string> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册