Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix spurious addition hunks in files with no git repo (#24288)

Cole Millerffe503d77c52
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index dab3ef5d718..6304a56b665 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -14478,10 +14478,8 @@ fn get_uncommitted_changes_for_buffer(
let change_sets = futures::future::join_all(tasks).await;
buffer
.update(&mut cx, |buffer, cx| {
- for change_set in change_sets {
- if let Some(change_set) = change_set.log_err() {
- buffer.add_change_set(change_set, cx);
- }
+ for change_set in change_sets.into_iter().flatten() {
+ buffer.add_change_set(change_set, cx);
}
})
.ok();
diff --git a/crates/worktree/src/worktree.rs b/crates/worktree/src/worktree.rs
index cc6075f07a6..c87187a32e3 100644
--- a/crates/worktree/src/worktree.rs
+++ b/crates/worktree/src/worktree.rs
@@ -886,7 +886,7 @@ impl Worktree {
}
}
}
- Ok(None)
+ Err(anyhow!("No repository found for {path:?}"))
})
}
Worktree::Remote(_) => {
@@ -910,7 +910,7 @@ impl Worktree {
}
}
}
- Ok(None)
+ Err(anyhow!("No repository found for {path:?}"))
})
}
Worktree::Remote(_) => Task::ready(Err(anyhow!(