pre-commit hook: gofmt files from git index rather than working directory.

Fixes http://camlistore.org/issue/245

Change-Id: Ib5647ad7d0f05141243732923112bc9597cb1512
This commit is contained in:
Salman Aljammaz 2013-10-23 18:21:27 +01:00
parent c16ada0121
commit 7b870f3d9e
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ do
javafile=`echo $c | grep -E '.*\.java$'`
if [ -n "$gofile" ]
then
fmtdiff=`gofmt -d $c 2>&1`
fmtdiff=`git show ":$c" | gofmt -d 2>&1`
if [ -n "$fmtdiff" ]
then
echo "gofmt needed on "$c