{"record":{"id":"4aca7d86cfc409d2","repo":"jdx/mise","slug":"network-git-calls-do-not-accept-a-work-tree-alter","errorCode":null,"errorMessage":"network Git calls do not accept a work tree, alternate index, or stdin","messagePattern":"network Git calls do not accept a work tree, alternate index, or stdin","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/git.rs","lineNumber":875,"sourceCode":"            .stderr(std::process::Stdio::inherit())\n            .stdin(std::process::Stdio::null());\n        cmd.status()\n            .wrap_err_with(|| format!(\"failed to run {}\", describe_plumbing(&cmd)))\n    }\n\n    /// Runs the call and returns its trimmed stdout.\n    pub(crate) fn output_str(&self, call: PlumbingCall<'_>) -> Result<String> {\n        let out = self.output(call)?;\n        Ok(String::from_utf8_lossy(&out).trim().to_string())\n    }\n\n    /// Runs a network command (`fetch`, `push`, `ls-remote`) against this\n    /// repository with the user's normal git configuration: credential\n    /// helpers, ssh settings, and URL rewrites apply, while hooks, filters,\n    /// and aliases still cannot act on mise's repository because only\n    /// plumbing runs here. Prompts are disabled when nobody is attending.\n    pub(crate) fn network_output(&self, call: PlumbingCall<'_>) -> Result<std::process::Output> {\n        eyre::ensure!(\n            call.work_tree.is_none() && call.index_file.is_none() && call.stdin.is_none(),\n            \"network Git calls do not accept a work tree, alternate index, or stdin\"\n        );\n        let git =\n            plumbing_binary().ok_or_else(|| eyre!(\"no unattended git executable is available\"))?;\n        let mut cmd = std::process::Command::new(git);\n        sanitize_git_command(&mut cmd);\n        if !console::user_attended_stderr() {\n            cmd.env(\"GIT_TERMINAL_PROMPT\", \"0\");\n        }\n        cmd.args([\n            \"-c\",\n            &github_credential_config(\"github.com\"),\n            \"-c\",\n            &github_credential_config(\"github.com:443\"),\n        ]);\n        cmd.env(\"GIT_OPTIONAL_LOCKS\", \"0\")\n            .env(\"LC_ALL\", \"C\")","sourceCodeStart":857,"sourceCodeEnd":893,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/git.rs#L857-L893","documentation":"API-misuse guard in Git network_output: a network plumbing call (fetch/push/ls-remote) was constructed with a work tree, alternate index, or stdin redirection, which the network-call API forbids — network commands must run with the user's normal git configuration and environment. This is an internal contract check, not a user-input error.","triggerScenarios":"Thrown at src/git.rs:875 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the call site to use the plain network call API without work tree/index/stdin overrides","Use the non-network plumbing API for local operations that need those options","Add/adjust the debug output to identify the offending PlumbingCall"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}