From d8a5418f1e068370397c7571399bb06e378bb336 Mon Sep 17 00:00:00 2001 From: joshaber Date: Mon, 4 Jan 2016 12:14:24 -0500 Subject: [PATCH] Only refresh the status for the open project. --- src/git-repository-async.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/git-repository-async.js b/src/git-repository-async.js index 9eb643cc8..bfe3bb1ab 100644 --- a/src/git-repository-async.js +++ b/src/git-repository-async.js @@ -774,8 +774,14 @@ export default class GitRepositoryAsync { _refreshStatus () { this._refreshingCount++ - return this.repoPromise - .then(repo => repo.getStatus()) + const projectPathsPromises = this.project.getPaths() + .map(p => this.relativizeToWorkingDirectory(p)) + + Promise.all(projectPathsPromises) + .then(paths => paths.filter(p => p.length > 0)) + .then(projectPaths => { + return this._getStatus(projectPaths.length > 0 ? projectPaths : null) + }) .then(statuses => { const statusPairs = statuses.map(status => [status.path(), status.statusBit()]) return Promise.all(statusPairs)