summaryrefslogtreecommitdiff
path: root/git-hooks
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2010-12-10 04:26:42 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2011-01-10 21:35:22 -0600
commit036e0e6d788992aa4f9e384e31187c0df89d239e (patch)
tree74923efa93949d8efb7c2391392d84b2f3bc6ad4 /git-hooks
parent03c2a4a770f3e705243584089139e214f7d44507 (diff)
new gbuild system
Diffstat (limited to 'git-hooks')
-rwxr-xr-xgit-hooks/pre-commit7
1 files changed, 4 insertions, 3 deletions
diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit
index b6581a431989..45153ee04018 100755
--- a/git-hooks/pre-commit
+++ b/git-hooks/pre-commit
@@ -19,8 +19,8 @@ sub fix_whitespace($$) {
# usually we have nothing to do ;-)
return if ( keys( %{$lines} ) == 0 ||
- $file eq "" ||
- !( $file =~ /\.(c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|mk|MK|pl|pm|pmk|py|sdi|sh|src|tab)/ ) );
+ $file eq "" || $file eq "GNUmakefile" ||
+ !( $file =~ /\.(c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|MK|pl|pm|pmk|py|sdi|sh|src|tab)/ ) );
open( IN, "$file" ) || die "Cannot open $file for reading";
my ( $out, $tmpfile ) = mkstemp( "/tmp/whitespace-fixing-XXXXXX" );
@@ -126,7 +126,8 @@ my $err_ext = "";
open( FILES, "git diff-index --cached --name-only $against |" ) || die "Cannot run git diff-index.";
while ( my $file = <FILES> ) {
chomp( $file );
- if ( $file =~ /\.(c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|mk|MK|pmk|pl|pm|sdi|sh|src|tab|xcu|xml)$/) {
+ if ( $file ne "GNUmakefile" &&
+ $file =~ /\.(c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|MK|pmk|pl|pm|sdi|sh|src|tab|xcu|xml)$/) {
open( F, "git diff-index -p --cached $against -- '$file' |" );
while ( my $line = <F> ) {
if ( $line =~ /^\+ *\t/ ) {