This is meant to be working tree, not git dir.
this is bit more concise
actually test if the repository does exist or not
the directory needs to be clean or else JGit complains