diff options
Diffstat (limited to 'src/bin/git_remote_nostr/utils.rs')
| -rw-r--r-- | src/bin/git_remote_nostr/utils.rs | 18 |
1 files changed, 0 insertions, 18 deletions
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 { | |||
| 293 | false | 293 | false |
| 294 | } | 294 | } |
| 295 | 295 | ||
| 296 | pub fn report_on_sideband_progress(data: &[u8], term: &console::Term) { | ||
| 297 | if let Ok(data) = str::from_utf8(data) { | ||
| 298 | let data = data | ||
| 299 | .split(['\n', '\r']) | ||
| 300 | .find(|line| !line.is_empty()) | ||
| 301 | .unwrap_or(""); | ||
| 302 | if !data.is_empty() { | ||
| 303 | let s = format!("remote: {data}"); | ||
| 304 | let _ = term.clear_last_lines(1); | ||
| 305 | let _ = term.write_line(s.as_str()); | ||
| 306 | if !s.contains('%') || s.contains("100%") { | ||
| 307 | // print it twice so the next sideband_progress doesn't delete it | ||
| 308 | let _ = term.write_line(s.as_str()); | ||
| 309 | } | ||
| 310 | } | ||
| 311 | } | ||
| 312 | } | ||
| 313 | |||
| 314 | #[cfg(test)] | 296 | #[cfg(test)] |
| 315 | mod tests { | 297 | mod tests { |
| 316 | use super::*; | 298 | use super::*; |