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.

git: Fix graph view slow initial loading times (#47453)

Anthony Eidd3b1f7f042da
diff --git a/crates/git_graph/src/git_graph.rs b/crates/git_graph/src/git_graph.rs
index 5fda56c0868..fc1db52cd1b 100644
--- a/crates/git_graph/src/git_graph.rs
+++ b/crates/git_graph/src/git_graph.rs
@@ -620,6 +620,9 @@ impl GitGraph {
if let Some(repository) = project.read(cx).active_repository(cx) {
repository.update(cx, |repository, cx| {
+ // This won't overlap with loading commits from the repository because
+ // we either have all commits or commits loaded in chunks and loading commits
+ // from the repository event is always adding the last chunk of commits.
let commits =
repository.graph_data(log_source.clone(), log_order, 0..usize::MAX, cx);
graph.add_commits(commits);
@@ -688,6 +691,8 @@ impl GitGraph {
}
_ => {}
}
+
+ cx.notify();
}
fn render_badge(&self, name: &SharedString, accent_color: gpui::Hsla) -> impl IntoElement {