uv
1ff7265e - respect --offline flag for git cli operations (#12619)

Commit
253 days ago
respect --offline flag for git cli operations (#12619) ## Summary closes #12234 [fetch_with_cli](https://github.com/thejchap/uv/blob/e0f81f0d4a904d8c743e776d9f8c9ef5b96f769c/crates/uv-git/src/git.rs#L573) doesn't respect the registry client's [connectivity setting](https://github.com/thejchap/uv/blob/e0f81f0d4a904d8c743e776d9f8c9ef5b96f769c/crates/uv-client/src/registry_client.rs#L1009) - this pr updates `fetch_with_cli` to set `GIT_ALLOW_PROTOCOL=file` when the client's connectivity setting is `Connectivity::Offline` ## Test Plan E2E ```sh cargo run add "pycurl @ git+https://github.com/pycurl/pycurl.git" --directory ~/src/offline-test/ --offline ``` ```sh Compiling uv-cli v0.0.1 (/Users/justinchapman/src/uv/crates/uv-cli) Compiling uv v0.6.11 (/Users/justinchapman/src/uv/crates/uv) Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.47s Running `target/debug/uv add 'pycurl @ git+https://github.com/pycurl/pycurl.git' --directory /Users/justinchapman/src/offline-test/ --offline` Updating https://github.com/pycurl/pycurl.git (HEAD) × Failed to download and build `pycurl @ git+https://github.com/pycurl/pycurl.git` ├─▶ Git operation failed ├─▶ failed to fetch into: /Users/justinchapman/.cache/uv/git-v0/db/9a596e5213c3162d ╰─▶ process didn't exit successfully: `/usr/bin/git fetch --force --update-head-ok 'https://github.com/pycurl/pycurl.git' '+HEAD:refs/remotes/origin/HEAD'` (exit status: 128) --- stderr fatal: transport 'https' not allowed help: If you want to add the package regardless of the failed resolution, provide the `--frozen` flag to skip locking and syncing. ``` --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
Author
Parents
Loading