build: Bring over git-status improvements from core

Change-Id: I34a55cf0e35175ee95eb3d56aefd64733fc86c7c
This commit is contained in:
Ed Sanders 2015-06-01 16:15:06 +01:00 committed by Esanders
parent ed936bdb11
commit 086535875f

View file

@ -95,9 +95,13 @@ module.exports = function ( grunt ) {
require( 'child_process' ).exec( 'git ls-files --modified', function ( err, stdout, stderr ) {
var ret = err || stderr || stdout;
if ( ret ) {
grunt.log.write( ret );
grunt.log.error( 'Unstaged changes.' );
done( false );
grunt.log.error( 'Unstaged changes in these files:' );
grunt.log.error( ret );
// Show a condensed diff
require( 'child_process' ).exec( 'git diff -U1 | tail -n +3', function ( err, stdout, stderr ) {
grunt.log.write( err || stderr || stdout );
done( false );
} );
} else {
grunt.log.ok( 'No unstaged changes.' );
done();