From 2eb62f261a145a3fac50694950509f9a35612de7 Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Thu, 27 Apr 2017 13:49:21 -0700 Subject: [PATCH] Make `git status` parallelizable So it turns out that while `status` writes to the index (for caching/perfomance purposes), it does not write if the index is locked. Therefore we don't have to worry about contention between status operations and can run them in parallel with other operations. --- lib/git-shell-out-strategy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/git-shell-out-strategy.js b/lib/git-shell-out-strategy.js index 68aa38b8b1..91013ac915 100644 --- a/lib/git-shell-out-strategy.js +++ b/lib/git-shell-out-strategy.js @@ -283,7 +283,7 @@ export default class GitShellOutStrategy { * File Status and Diffs */ async getStatusesForChangedFiles() { - const output = await this.exec(['status', '--untracked-files=all', '-z'], {writeOperation: true}); + const output = await this.exec(['status', '--untracked-files=all', '-z']); const statusMap = { 'A': 'added', @@ -392,7 +392,7 @@ export default class GitShellOutStrategy { async isPartiallyStaged(filePath) { const args = ['status', '--short', '--', filePath]; - const output = await this.exec(args, {writeOperation: true}); + const output = await this.exec(args); const results = output.trim().split(LINE_ENDING_REGEX); if (results.length === 2) { return true;