Ensure proper setup of git_dir for git-hash-object