Skip to content

Instantly share code, notes, and snippets.

@sztanpet
sztanpet / pre-commit
Last active September 4, 2015 21:04 — forked from hugowetterberg/cleanup.sed
#!php
<?php
$files = array();
exec('git diff-index --cached --name-only --diff-filter=ACMRTUXB HEAD', $files );
$exitcode = 0;
// dont redirect stderr to stdin, we will get the errors twice, redirect it to dev/null
if ( PHP_OS == 'WINNT' )
$redirect = ' 2> NUL';
else