From 024345f9998d19ce12c5a7f0f5eba8aee1a8ffe9 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 30 Jan 2026 13:21:11 +0100 Subject: [PATCH] editor: Deduplicate multibuffer blame error messages (#48013) Release Notes: - N/A *or* Added/Fixed/Improved ... --- crates/editor/src/git/blame.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/crates/editor/src/git/blame.rs b/crates/editor/src/git/blame.rs index 147989f984deda46ed7f7905df89add73439be25..c705eb3996ace228f915303f049853bb2364aa2e 100644 --- a/crates/editor/src/git/blame.rs +++ b/crates/editor/src/git/blame.rs @@ -610,21 +610,23 @@ impl GitBlame { cx.notify(); if !all_errors.is_empty() { this.project.update(cx, |_, cx| { + let all_errors = all_errors + .into_iter() + .map(|e| format!("{e:#}")) + .dedup() + .collect::>(); + let all_errors = all_errors.join(", "); if this.user_triggered { - log::error!("failed to get git blame data: {all_errors:?}"); - let notification = all_errors - .into_iter() - .format_with(",", |e, f| f(&format_args!("{:#}", e))) - .to_string(); + log::error!("failed to get git blame data: {all_errors}"); cx.emit(project::Event::Toast { notification_id: "git-blame".into(), - message: notification, + message: all_errors, link: None, }); } else { // If we weren't triggered by a user, we just log errors in the background, instead of sending // notifications. - log::debug!("failed to get git blame data: {all_errors:?}"); + log::debug!("failed to get git blame data: {all_errors}"); } }) }