Added some additional checks & variables to check_git_status

Hi,

I found the check_git_status script really useful and made some changes to it.
Feel free to reject it if you don't like it :)

1. Changed the "$REPO ! -d" check to $REPO/.git so that it will exit with an unknown state in case it's a regular directory without a .git.
2. Added some additional checks before the git command is being run.
3. Changed hardcoded exit codes to variables.
4. Changed git to $GIT
5. Added an exit state_unknown as last catchall in case something really breaks.