From 01619d3c34f7694527f4b7d7d4ccc203dcca083e Mon Sep 17 00:00:00 2001 From: Joao Date: Thu, 7 Sep 2017 12:15:45 +0200 Subject: [PATCH] git: internal git._syncAll command --- extensions/git/src/commands.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 08b020afd35..80fad68410e 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -1174,6 +1174,19 @@ export class CommandCenter { await repository.sync(); } + @command('git._syncAll') + async syncAll(): Promise { + await Promise.all(this.model.repositories.map(async repository => { + const HEAD = repository.HEAD; + + if (!HEAD || !HEAD.upstream) { + return; + } + + await repository.sync(); + })); + } + @command('git.publish', { repository: true }) async publish(repository: Repository): Promise { const remotes = repository.remotes;