Skip to content

Commit

Permalink
added recommended git pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
agladysh committed Sep 10, 2009
1 parent c238af7 commit d2e43a7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions etc/git/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

if git-rev-parse --verify HEAD 2>/dev/null
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi

git diff-index --check --cached $against -- || exit 1

# check lua syntax
for i in `git diff-index --cached HEAD | egrep "\\.lua$" | cut -d " " -f 4`; do
git show $i | luac -p - || exit 1
done

0 comments on commit d2e43a7

Please sign in to comment.