fix git_dir not being removed