Skip to content

Commit

Permalink
Improved commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
lavalamp committed Jun 13, 2014
1 parent f9a5fad commit 2328cad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hooks/prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

errors=0
for file in $(git diff --cached --name-only | grep "\.go"); do
diff="$(gofmt -d "${file}")"
diff="$(git show ":${file}" | gofmt -d)"
if [[ -n "$diff" ]]; then
echo "# *** ERROR: *** File ${file} has not been gofmt'd." >> $1
errors=1
Expand Down

0 comments on commit 2328cad

Please sign in to comment.