1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 1× 2× 2× 2× 1× 1× 2× | import git from 'gulp-git'; import {isString} from '../common/util'; export {isClean}; /** * Asynchrounously determines if the staging area is clean */ function isClean(repoPath, done) { git.exec({cwd:repoPath, args: '--no-pager diff --cached --name-only', quiet: true}, function (err, stdout) { let stagingIsClean; if(stdout && isString(stdout) && stdout.trim().length>0) { stagingIsClean = false; } else { stagingIsClean = true; } done(stagingIsClean); }); } |