zed-industries/zed · error

invalid git commit url: missing sha

Error message

invalid git commit url: missing sha

What it means

Raised in parse_git_commit_url while parsing a zed://.../git-commit URL: the path before the `?` did not split into a commit sha (missing or empty part before the query). The URL's commit_path argument is malformed, so the open request cannot be built.

Source

Thrown at crates/zed/src/zed/open_listener.rs:268

        let repo_url = url::form_urlencoded::parse(query.as_bytes())
            .find_map(|(key, value)| (key == "repo").then_some(value))
            .filter(|s| !s.is_empty())
            .context("invalid git clone url: missing repo query parameter")?
            .to_string()
            .into();

        self.kind = Some(OpenRequestKind::GitClone { repo_url });

        Ok(())
    }

    fn parse_git_commit_url(&mut self, commit_path: &str) -> Result<()> {
        // Format: <sha>?repo=<path>
        let (sha, query) = commit_path
            .split_once('?')
            .context("invalid git commit url: missing query string")?;
        anyhow::ensure!(!sha.is_empty(), "invalid git commit url: missing sha");

        let repo = url::form_urlencoded::parse(query.as_bytes())
            .find_map(|(key, value)| (key == "repo").then_some(value))
            .filter(|s| !s.is_empty())
            .context("invalid git commit url: missing repo query parameter")?
            .to_string();

        self.open_paths.push(repo);

        self.kind = Some(OpenRequestKind::GitCommit {
            sha: sha.to_string(),
        });

        Ok(())
    }

    fn parse_ssh_file_path(&mut self, file: &str, cx: &App) -> Result<()> {
        let url = parse_ssh_url(file)?;

View on GitHub (pinned to f4178619ac)

Solutions

  1. Use a well-formed commit URL: zed://commit/<sha>?repo=<path>
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/zed/src/zed/open_listener.rs:268 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/321580bb34aa0140. Report an issue: GitHub.