Add GIT_DIR variable checking

If the GIT_DIR environment variable is set then it
specifies a path to use instead of the default
.git for the base of the repository.
Merge pull request #42 from evvers/git-dir-checking

Add GIT_DIR variable checking