fix: set GIT_TERMINAL_PROMPT=0 so invalid git deps fail fast#5988
Merged
baszalmstra merged 1 commit intoprefix-dev:mainfrom May 4, 2026
Merged
Conversation
When a host- or source-dependency points at a non-existent GitHub repository, the GitHub API fast path returns 404 and we fall back to shelling out to `git fetch`. Without `GIT_TERMINAL_PROMPT=0`, git reaches for the controlling TTY to prompt for HTTPS credentials and hangs forever on `cmd.output()`. Set the env var so git fails fast with a normal error, matching uv-git's behaviour. Also stop using `error_for_status_ref()?` in `github_fast_path`: the fast path is just an optimization, so any non-success status (404, 422, 403, 5xx) should cleanly return `Indeterminate` and let the caller try a real fetch instead of bubbling an error up only to be swallowed at the call site. Fixes prefix-dev#5503
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a host- or source-dependency points at a non-existent GitHub repository, the GitHub API fast path returns 404 and pixi falls back to shelling out to
git fetch. WithoutGIT_TERMINAL_PROMPT=0, git reaches for the controlling TTY to prompt for HTTPS credentials and hangs forever oncmd.output(). Setting the env var makes git fail fast with a normal error.While in the area, also stop using
error_for_status_ref()?ingithub_fast_path. The fast path is just an optimization, so any non-success status (404 missing repo, 422 unresolvable rev, 403 rate-limit, 5xx) should cleanly returnIndeterminateand let the caller fall back to a real fetch instead of bubbling an error up only to be swallowed at the call site. The trailingIndeterminatebranch was effectively dead code before this change.Fixes #5503
How Has This Been Tested?
cargo build -p pixi_gitsucceeds.cargo test -p pixi_git --libpasses (4/4).https://github.com/crosaderky/cpython(a 404 repo) now surfaces a normal git error instead of hanging indefinitely on the credential prompt.AI Disclosure
Tools: Claude (Claude Code)
Checklist: