#!/bin/sh
git_root=`git rev-parse --show-cdup`

if [ -z "$git_root" ]; then
    exit -1
fi

cd "$git_root"

#B=`git --git-dir="$GIT_DIR" rev-parse --is-bare-repository `
#if [ "$B" = "true" ]; then
#	exit 0
#fi

COUNT=`git status -s | wc -l`

if ! [ "$COUNT" = "0" ]; then
	echo "You need to commit"
	exit 1
fi

COUNT2=`git diff HEAD | wc -l`

if [ "$COUNT2" = "0" ]; then
	exit
fi

echo "You need to commit"
exit 1
