From fb48125595af09c557d03013e4e096d1d072e791 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 13 Sep 2024 20:55:12 +0100 Subject: fix(remote): add robustness to push reporting by avoiding bugs where lines are removed accidentally by storing report in a mutex and rewriting the entire report at each update --- src/bin/git_remote_nostr/utils.rs | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/bin/git_remote_nostr/utils.rs') diff --git a/src/bin/git_remote_nostr/utils.rs b/src/bin/git_remote_nostr/utils.rs index bbe7cfa..a13d398 100644 --- a/src/bin/git_remote_nostr/utils.rs +++ b/src/bin/git_remote_nostr/utils.rs @@ -293,24 +293,6 @@ pub fn error_might_be_authentication_related(error: &anyhow::Error) -> bool { false } -pub fn report_on_sideband_progress(data: &[u8], term: &console::Term) { - if let Ok(data) = str::from_utf8(data) { - let data = data - .split(['\n', '\r']) - .find(|line| !line.is_empty()) - .unwrap_or(""); - if !data.is_empty() { - let s = format!("remote: {data}"); - let _ = term.clear_last_lines(1); - let _ = term.write_line(s.as_str()); - if !s.contains('%') || s.contains("100%") { - // print it twice so the next sideband_progress doesn't delete it - let _ = term.write_line(s.as_str()); - } - } - } -} - #[cfg(test)] mod tests { use super::*; -- cgit v1.2.3