uv
37a71fd2 - Make `uv init` resilient against broken git (#12895)

Commit
239 days ago
Make `uv init` resilient against broken git (#12895) Currently, `uv init` works without a `git` executable, and with a working `git` executable, but not with a broken `git`, be it from GitHub Action's Windows CI or from the shim we insert. `uv init` calls git twice: Once `git rev-parse` to check whether a git repo already exists, and then `git init` (if there is no git repository yet and no `--vcs none`). By separately handling the cases where git failed during `git rev-parse` doesn't work vs. where the is no repository when checking for an existing repo work tree, we can avoid calling `git init` for broken git and erroring. We have to hardcode the expected git command outputs to be able to check.
Author
Parents
Loading