zed-industries/zed · error

`git {}` within `{}` failed with status: {} stderr: {} stdou

Error message

`git {}` within `{}` failed with status: {}
stderr:
{}
stdout:
{}

What it means

run_git executed a git subprocess in the given repository and it exited non-zero; the message includes the subcommand args, repo path, exit status, and captured stderr/stdout so the underlying git failure is visible. It is the generic wrapper for any failed git invocation in the eval CLI.

Source

Thrown at crates/edit_prediction_cli/src/git.rs:36

    REPO_LOCKS
        .with(|cell| {
            cell.borrow_mut()
                .entry(path.as_ref().to_path_buf())
                .or_default()
                .clone()
        })
        .lock_owned()
        .await
}

pub async fn run_git(repo_path: &Path, args: &[&str]) -> Result<String> {
    let output = smol::process::Command::new("git")
        .current_dir(repo_path)
        .args(args)
        .output()
        .await?;

    anyhow::ensure!(
        output.status.success(),
        "`git {}` within `{}` failed with status: {}\nstderr:\n{}\nstdout:\n{}",
        args.join(" "),
        repo_path.display(),
        output.status,
        String::from_utf8_lossy(&output.stderr),
        String::from_utf8_lossy(&output.stdout),
    );
    Ok(String::from_utf8(output.stdout)?.trim().to_string())
}

pub fn parse_repo_url(url: &str) -> Result<(String, String)> {
    if url.contains('@') {
        let (_, path) = url.split_once(':').context("expected : in git url")?;
        let (owner, repo) = path.split_once('/').context("expected / in git url")?;
        Ok((owner.to_string(), repo.trim_end_matches(".git").to_string()))
    } else {
        let parsed = http_client::Url::parse(url)?;

View on GitHub (pinned to f4178619ac)

Solutions

  1. Read the embedded stderr to see git's own error (missing ref, dirty tree, auth)
  2. Fix the repository state or arguments and re-run
  3. Ensure git is installed and the repo is fully fetched
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/edit_prediction_cli/src/git.rs:36 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/a302b7c9995eab94. Report an issue: GitHub.