upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/bin/git_remote_nostr/push.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/git_remote_nostr/push.rs')
-rw-r--r--src/bin/git_remote_nostr/push.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs
index a0bcea3..05c9197 100644
--- a/src/bin/git_remote_nostr/push.rs
+++ b/src/bin/git_remote_nostr/push.rs
@@ -39,9 +39,10 @@ use crate::{
39 git::Repo, 39 git::Repo,
40 list::list_from_remotes, 40 list::list_from_remotes,
41 utils::{ 41 utils::{
42 find_proposal_and_patches_by_branch_name, get_all_proposals, get_remote_name_by_url, 42 count_lines_per_msg_vec, find_proposal_and_patches_by_branch_name, get_all_proposals,
43 get_short_git_server_name, get_write_protocols_to_try, join_with_and, 43 get_remote_name_by_url, get_short_git_server_name, get_write_protocols_to_try,
44 push_error_is_not_authentication_failure, read_line, set_protocol_preference, Direction, 44 join_with_and, push_error_is_not_authentication_failure, read_line,
45 set_protocol_preference, Direction,
45 }, 46 },
46}; 47};
47 48
@@ -580,10 +581,11 @@ impl<'a> PushReporter<'a> {
580 } 581 }
581 582
582 fn count_all_existing_lines(&self) -> usize { 583 fn count_all_existing_lines(&self) -> usize {
583 self.remote_msgs.len() 584 let width = self.term.size().1;
584 + self.negotiation.len() 585 count_lines_per_msg_vec(width, &self.remote_msgs, "remote: ".len())
585 + self.transfer_progress_msgs.len() 586 + count_lines_per_msg_vec(width, &self.negotiation, 0)
586 + self.update_reference_errors.len() 587 + count_lines_per_msg_vec(width, &self.transfer_progress_msgs, 0)
588 + count_lines_per_msg_vec(width, &self.update_reference_errors, 0)
587 } 589 }
588 fn process_remote_msg(&mut self, data: &[u8]) { 590 fn process_remote_msg(&mut self, data: &[u8]) {
589 if let Ok(data) = str::from_utf8(data) { 591 if let Ok(data) = str::from_utf8(data) {