Index: Gruntfile.js
===================================================================
--- Gruntfile.js	(revision 37153)
+++ Gruntfile.js	(working copy)
@@ -1,7 +1,7 @@
 /* jshint node:true */
 module.exports = function(grunt) {
 	var path = require('path'),
-		gitorsvn = require('git-or-svn'),
+		fs = require( 'fs' ),
 		SOURCE_DIR = 'src/',
 		BUILD_DIR = 'build/',
 		autoprefixer = require('autoprefixer'),
@@ -295,6 +295,10 @@
 		jshint: {
 			options: grunt.file.readJSON('.jshintrc'),
 			grunt: {
+				options: {
+					es3: false,
+					esversion: 6
+				},
 				src: ['Gruntfile.js']
 			},
 			tests: {
@@ -689,57 +693,50 @@
 
 	grunt.registerTask( 'precommit', 'Runs test and build tasks in preparation for a commit', function() {
 		var done = this.async();
+		var map = {
+			svn: 'svn status',
+			git: 'git diff --name-only'
+		};
+
+		function run( type ) {
+			var command = map[ type ].split( ' ' );
+			var taskList = [ 'precommit:base' ];
+
+			grunt.util.spawn( {
+				cmd: command.shift(),
+				args: command
+			}, ( error, result, code ) => {
+				if ( code !== 0 ) {
+					grunt.fail.warn( 'The `' +  map[ type ] + '` command returned a non-zero exit code.', code );
+				}
 
-		// Figure out what tasks to run based on what files have been modified.
-		function enqueueTestingTasksForModifiedFiles( filesModified ) {
-			var taskList = ['precommit:base'];
-			if ( /.*\.js/.test( filesModified ) ) {
-				grunt.log.write( 'JavaScript source files modified. JavaScript tests will be run.\n');
-				taskList = taskList.concat( ['precommit:js'] );
-			}
-			if ( /src.*\.css/.test( filesModified ) ) {
-				grunt.log.write( 'CSS source files modified. CSS tests will be run.\n');
-				taskList = taskList.concat( ['postcss:core'] );
-			}
-			if ( /.*\.php/.test( filesModified ) ) {
-				grunt.log.write( 'PHP source files modified. PHP tests will be run.\n');
-				taskList = taskList.concat( ['precommit:php'] );
-			}
-			grunt.task.run( taskList );
-			done();
-		}
-		gitorsvn( __dirname, function(gitorsvn) {
-			if ( gitorsvn === 'svn' ) {
-				grunt.util.spawn(
-					{
-						cmd: 'svn',
-						args: ['status']
-					},
-					function(error, result, code) {
-						if ( code !== 0 ) {
-							grunt.fail.warn( 'The `svn status` command returned a non-zero exit code.', code );
-						}
-						enqueueTestingTasksForModifiedFiles( result.stdout );
+				[ 'js', 'css', 'php' ].forEach( function( extension ) {
+					if ( result.stdout.indexOf( '.' + extension + '\n' ) !== -1 ) {
+						grunt.log.write( extension.toUpperCase() + ' files modified. ' + extension.toUpperCase() + ' tests will be run.\n');
+						taskList.push( 'precommit:' + extension );
 					}
-				);
-			} else if ( gitorsvn === 'git' ) {
-				grunt.util.spawn(
-					{
-						cmd: 'git',
-						args: ['diff', '--name-only']
-					},
-					function(error, result, code) {
-						if ( code !== 0 ) {
-							grunt.fail.warn( 'The `git diff --name-only` command returned a non-zero exit code.', code );
-						}
-						enqueueTestingTasksForModifiedFiles( result.stdout );
+				} );
+
+				grunt.task.run( taskList );
+
+				done();
+			} );
+		}
+
+		fs.access( __dirname + '/.svn', fs.F_OK, ( error ) => {
+			if ( error ) {
+				fs.access( __dirname + '/.git', fs.F_OK, ( error ) => {
+					if ( error ) {
+						grunt.log.write( 'This WordPress install is not under version control. No tests will be run.' );
+					} else {
+						run( 'git' );
 					}
-				);
+				} );
 			} else {
-				grunt.log.write( 'This WordPress install is not under version control. No tests will be run.' );
+				run( 'svn' );
 			}
-		});
-	});
+		} );
+	} );
 
 	grunt.registerTask( 'copy:all', [
 		'copy:files',
