From 0b9ebd63be13ee403c415d4a29538b94f9e7cffe Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 6 Sep 2024 11:29:27 +0100 Subject: feat(remote): just use ssh if auth succeeds and don't proceed to https or http --- src/bin/git_remote_nostr/list.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/bin/git_remote_nostr/list.rs') diff --git a/src/bin/git_remote_nostr/list.rs b/src/bin/git_remote_nostr/list.rs index 26f699d..ae76614 100644 --- a/src/bin/git_remote_nostr/list.rs +++ b/src/bin/git_remote_nostr/list.rs @@ -22,7 +22,8 @@ use repo_ref::RepoRef; use crate::{ git::Repo, utils::{ - get_open_proposals, get_read_protocols_to_try, get_short_git_server_name, join_with_and, + error_is_not_authentication_failure, get_open_proposals, get_read_protocols_to_try, + get_short_git_server_name, join_with_and, }, }; @@ -196,6 +197,10 @@ pub fn list_from_remote( format!("list: {formatted_url} failed over {protocol}: {error}").as_str(), )?; failed_protocols.push(protocol); + if protocol == &ServerProtocol::Ssh && error_is_not_authentication_failure(&error) { + // authenticated by failed to complete request + break; + } } } term.clear_last_lines(1)?; -- cgit v1.2.3