zed-industries/zed · error
Failed to get all remotes: {}
Error message
Failed to get all remotes:
{} What it means
ensure! guard failing when `git remote -v` exits non-zero while enumerating repository remotes. The remote list cannot be produced, indicating the command ran outside a git repository or git itself failed (missing binary, corrupt repo).
Source
Thrown at crates/git/src/repository.rs:2926
cx: AsyncApp,
) -> BoxFuture<'_, Result<RemoteCommandOutput>> {
let working_directory = self.command_directory();
let git_directory = self.path();
let remote_name = format!("{}", fetch_options);
let git_binary_path = self.system_git_binary_path.clone();
let executor = cx.background_executor().clone();
let is_trusted = self.is_trusted();
// Note: Do not spawn this command on the background thread, it might pop open the credential helper
// which we want to block on.
async move {
let git_binary_path = git_binary_path.context("git not found on $PATH, can't fetch")?;
let git = GitBinary::new(
git_binary_path,
working_directory,
git_directory,
executor.clone(),
is_trusted,
);
let mut command = git.build_command(&["fetch", &remote_name]);
command
.envs(env.iter())
.stdout(Stdio::piped())
.stderr(Stdio::piped());
run_git_command(env, ask_pass, command, executor).await
}
.boxed()
}
fn get_push_remote(&self, branch: String) -> BoxFuture<'_, Result<Option<Remote>>> {
let git = self.git_binary();
self.executor
.spawn(async move {
let output = git
.build_command(&["rev-parse", "--abbrev-ref"])
.arg(format!("{branch}@{{push}}"))View on GitHub (pinned to 5a9b9558db)
Solutions
- Read git stderr in the error ('not a git repository' is the common case)
- Confirm the command's working directory is inside a valid repository
- Verify the git binary is installed and on PATH
- Return an empty remote list to callers if the repo genuinely has none after recovery
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at crates/git/src/repository.rs:2912 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@5a9b9558db (2026-08-20).
Data as JSON: /api/errors/ab66fbd6163b8572.
Report an issue: GitHub.