From c7faf80ab9d2639211d3978f1527286b3ce86ce0 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 11 Sep 2024 15:51:10 +0100 Subject: fix(remote): update copy to make it more like native git --- src/bin/git_remote_nostr/fetch.rs | 6 +----- src/bin/git_remote_nostr/list.rs | 6 +----- src/bin/git_remote_nostr/push.rs | 6 +----- src/lib/git/nostr_url.rs | 6 +++--- 4 files changed, 6 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/bin/git_remote_nostr/fetch.rs b/src/bin/git_remote_nostr/fetch.rs index 83b94b8..baf56ed 100644 --- a/src/bin/git_remote_nostr/fetch.rs +++ b/src/bin/git_remote_nostr/fetch.rs @@ -121,11 +121,7 @@ fn fetch_from_git_server( let mut success = false; for protocol in &protocols_to_attempt { term.write_line( - format!( - "fetching over {protocol} from {}...", - server_url.short_name(), - ) - .as_str(), + format!("fetching {} over {protocol}...", server_url.short_name(),).as_str(), )?; let formatted_url = server_url.format_as(protocol, &decoded_nostr_url.user)?; diff --git a/src/bin/git_remote_nostr/list.rs b/src/bin/git_remote_nostr/list.rs index c8843e3..d3682ec 100644 --- a/src/bin/git_remote_nostr/list.rs +++ b/src/bin/git_remote_nostr/list.rs @@ -164,11 +164,7 @@ pub fn list_from_remote( for protocol in &protocols_to_attempt { term.write_line( - format!( - "fetching ref list over {protocol} from {}...", - server_url.short_name(), - ) - .as_str(), + format!("fetching {} ref list over {protocol}...", server_url.short_name(),).as_str(), )?; let formatted_url = server_url.format_as(protocol, &decoded_nostr_url.user)?; diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs index 364555a..7f63eb0 100644 --- a/src/bin/git_remote_nostr/push.rs +++ b/src/bin/git_remote_nostr/push.rs @@ -355,11 +355,7 @@ fn push_to_remote( for protocol in &protocols_to_attempt { term.write_line( - format!( - "fetching ref list over {protocol} from {}...", - server_url.short_name(), - ) - .as_str(), + format!("fetching {} ref list over {protocol}...", server_url.short_name(),).as_str(), )?; let formatted_url = server_url.format_as(protocol, &decoded_nostr_url.user)?; diff --git a/src/lib/git/nostr_url.rs b/src/lib/git/nostr_url.rs index d0e6d8a..6fcc11d 100644 --- a/src/lib/git/nostr_url.rs +++ b/src/lib/git/nostr_url.rs @@ -28,8 +28,8 @@ impl fmt::Display for ServerProtocol { ServerProtocol::Git => write!(f, "git"), ServerProtocol::Filesystem => write!(f, "filesystem"), ServerProtocol::Unspecified => write!(f, "unsepcified"), - ServerProtocol::UnauthHttps => write!(f, "unauthenticated https"), - ServerProtocol::UnauthHttp => write!(f, "unauthenticated http"), + ServerProtocol::UnauthHttps => write!(f, "https (unauthenticated)"), + ServerProtocol::UnauthHttp => write!(f, "http (unauthenticated)"), } } } @@ -330,7 +330,7 @@ impl CloneUrl { if domain.is_empty() { self.original_string.to_string() } else { - domain + format!("{domain}{}", self.path) } } } -- cgit v1.2.3