Only refresh the status for the open project.

This commit is contained in:
joshaber
2016-01-04 12:14:24 -05:00
parent 73cb867ccd
commit d8a5418f1e

View File

@@ -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)