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 add safe directory button doing nothing (#58705)

Cole Millere5c370b3b243
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs
index ce21a74c452..8dd47948a89 100644
--- a/crates/git_ui/src/git_panel.rs
+++ b/crates/git_ui/src/git_panel.rs
@@ -3174,7 +3174,7 @@ impl GitPanel {
/// worktree to the `safe.directory` config, ensuring that, even if the user
/// that's running the application is not the owner of `.git/`, it can still
/// read the repository's contents.
- fn add_safe_directory(&mut self, window: &mut Window, cx: &mut Context<Self>) {
+ fn add_safe_directory(&mut self, _window: &mut Window, cx: &mut Context<Self>) {
let Some(active_repository) = &self.active_repository else {
return;
};
@@ -3192,12 +3192,10 @@ impl GitPanel {
path_arg,
];
- cx.spawn_in(window, async move |git_panel, cx| {
- git_panel.update(cx, |git_panel, cx| {
- git_panel.project.read(cx).git_config(path, args, cx)
- })
- })
- .detach();
+ self.project
+ .read(cx)
+ .git_config(path, args, cx)
+ .detach_and_log_err(cx);
}
}