From 107c955ec4c44e784de09c62460bf91896ca88f8 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sat, 8 Dec 2018 11:23:05 -0500 Subject: [PATCH] Fixes notification progress reporting --- src/git/gitService.ts | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/git/gitService.ts b/src/git/gitService.ts index 621457c..0b6c4f9 100644 --- a/src/git/gitService.ts +++ b/src/git/gitService.ts @@ -502,13 +502,11 @@ export class GitService implements Disposable { cancellable: true }, async (progress, token) => { - const total = repositories.length + 1; - let i = 0; + const total = repositories.length; for (const repo of repositories) { - i++; progress.report({ message: `${repo.formattedName}...`, - increment: (i / total) * 100 + increment: 100 / total }); if (token.isCancellationRequested) break; @@ -532,13 +530,11 @@ export class GitService implements Disposable { cancellable: true }, async (progress, token) => { - const total = repositories.length + 1; - let i = 0; + const total = repositories.length; for (const repo of repositories) { - i++; progress.report({ message: `${repo.formattedName}...`, - increment: (i / total) * 100 + increment: 100 / total }); if (token.isCancellationRequested) break; @@ -562,13 +558,11 @@ export class GitService implements Disposable { cancellable: true }, async (progress, token) => { - const total = repositories.length + 1; - let i = 0; + const total = repositories.length; for (const repo of repositories) { - i++; progress.report({ message: `${repo.formattedName}...`, - increment: (i / total) * 100 + increment: 100 / total }); if (token.isCancellationRequested) break;