From 1a35545bd70022eb348c2878c4d97981b2ed648e Mon Sep 17 00:00:00 2001 From: joshaber Date: Mon, 4 Jan 2016 12:48:29 -0500 Subject: [PATCH] _destroyed => _isDestroyed --- src/git-repository-async.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/git-repository-async.js b/src/git-repository-async.js index 9f414ecf9..658d3ddbd 100644 --- a/src/git-repository-async.js +++ b/src/git-repository-async.js @@ -780,6 +780,8 @@ export default class GitRepositoryAsync { Promise.all(projectPathsPromises) .then(paths => paths.filter(p => p.length > 0)) .then(projectPaths => { + if (this._isDestroyed()) return [] + return this._getStatus(projectPaths.length > 0 ? projectPaths : null) }) .then(statuses => { @@ -818,7 +820,7 @@ export default class GitRepositoryAsync { // // Returns a {Promise} which resolves to the {NodeGit.Repository}. getRepo (_path) { - if (this._destroyed()) { + if (this._isDestroyed()) { const error = new Error('Repository has been destroyed') error.name = GitRepositoryAsync.DestroyedErrorName return Promise.reject(error) @@ -849,7 +851,7 @@ export default class GitRepositoryAsync { // Has the repository been destroyed? // // Returns a {Boolean}. - _destroyed () { + _isDestroyed () { return this.repoPromise == null }