* Asynchrounously determines if the staging area is clean
(repoPath, done, stageAllFiles)
| 6 | * Asynchrounously determines if the staging area is clean |
| 7 | */ |
| 8 | function isClean (repoPath, done, stageAllFiles) { |
| 9 | exec(`git diff --cached --no-ext-diff --name-only ${!!stageAllFiles ? '&& git diff --no-ext-diff --name-only' : ''}`, { |
| 10 | maxBuffer: Infinity, |
| 11 | cwd: repoPath |
| 12 | }, function (error, stdout) { |
| 13 | if (error) { |
| 14 | return done(error); |
| 15 | } |
| 16 | let output = stdout || ''; |
| 17 | done(null, output.trim().length === 0); |
| 18 | }); |
| 19 | } |