From e4dcbd7df2c1e16d49ccab68b364148deb2bca2f Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 17 Jun 2025 19:11:15 +0100 Subject: fix: support `git://` in clone urls based on jb55 trying to use this with damus nostr:event1qvzqqqqqqypzqvhpsfmr23gwhv795lgjc8uw0v44z3pe4sg2vlh08k0an3wx3cj9qy88wumn8ghj7mn0wvhxcmmv9uq3jamnwvaz7tmjv4kxz7fwwdhx7un59eek7cmfv9kz7qpqec3c59c4yu4yrsa9fedu27rnygnemj2cfmumf6fw7385wfthg57slj72ux --- src/bin/git_remote_nostr/utils.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/bin/git_remote_nostr/utils.rs b/src/bin/git_remote_nostr/utils.rs index 2c77baa..ec6412b 100644 --- a/src/bin/git_remote_nostr/utils.rs +++ b/src/bin/git_remote_nostr/utils.rs @@ -238,6 +238,14 @@ pub fn get_read_protocols_to_try( ] } else if server_url.protocol() == ServerProtocol::Ftp { vec![ServerProtocol::Ftp, ServerProtocol::Ssh] + } else if server_url.protocol() == ServerProtocol::Git { + vec![ + ServerProtocol::Git, + ServerProtocol::UnauthHttps, + ServerProtocol::Ssh, + // note: list and fetch stop here if ssh was authenticated + ServerProtocol::Https, + ] } else { vec![ ServerProtocol::UnauthHttps, @@ -282,6 +290,13 @@ pub fn get_write_protocols_to_try( ] } else if server_url.protocol() == ServerProtocol::Ftp { vec![ServerProtocol::Ssh, ServerProtocol::Ftp] + } else if server_url.protocol() == ServerProtocol::Git { + vec![ + ServerProtocol::Ssh, + ServerProtocol::Git, + // note: list and fetch stop here if ssh was authenticated + ServerProtocol::Https, + ] } else { vec![ ServerProtocol::Ssh, -- cgit v1.2.3