zed-industries/zed · error

cannot blame binary file {:?} at revision {revision}

Error message

cannot blame binary file {:?} at revision {revision}

What it means

Raised while producing a blame for a buffer: the file at the given repository path is binary at the requested revision, so `git blame` cannot produce line-level attribution. The operation is rejected rather than returning meaningless output.

Source

Thrown at crates/project/src/git_store.rs:10138

                                project_id: project_id.to_proto(),
                                repository_id: repository_id.0,
                                path: path.as_unix_str().to_owned(),
                                revision: revision.to_string(),
                            })
                            .await?;
                        let blame = blame_from_proto(
                            response.entries,
                            response.messages,
                            response.tag_names,
                        );
                        Ok((response.content, blame))
                    }
                }
            }
        });
        cx.spawn(move |_: &mut AsyncApp| async move {
            let (content, blame) = rx.await??;
            anyhow::ensure!(
                !is_binary_content(content.as_bytes()),
                "cannot blame binary file {:?} at revision {revision}",
                path.as_ref()
            );
            Ok((content, blame))
        })
    }

    fn load_blob_content(&mut self, oid: Oid, cx: &App) -> Task<Result<String>> {
        let repository_id = self.snapshot.id;
        let rx = self.send_job("load_blob_content", None, move |state, _| async move {
            match state {
                RepositoryState::Local(LocalRepositoryState { backend, .. }) => {
                    decode_git_text(backend.load_blob_content(oid).await?)
                }
                RepositoryState::Remote(RemoteRepositoryState { client, project_id }) => {
                    let response = client
                        .request(proto::GetBlobContent {

View on GitHub (pinned to f4178619ac)

Solutions

  1. Blame a text revision of the file instead
  2. Verify the correct file path and revision were passed
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/project/src/git_store.rs:10138 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/51516ebfe9cdbac9. Report an issue: GitHub.