setup: split off $GIT_DIR-set case from setup_git_directory_gently