setup_git_directory_1(): avoid changing global state