upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/git_remote_nostr/list.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-09-09 07:36:47 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2024-09-09 07:36:47 +0100
commitd2d0eeb72912809a00f09fafdae4e827a34d0e26 (patch)
tree5f87f87ce8f068d4fa22a9f7f12701ea467bf0ff /src/bin/git_remote_nostr/list.rs
parentad28bd8db1a6e953dce999eea85becda1d90beae (diff)
feat(remote): push protocol selection / fallback
enable override from nostr url clone url is filesystem use filesystem otherwise try ssh, then https authenticated unless clone url is http, then try ssh then http as we assume, we are on a local trusted network.
Diffstat (limited to 'src/bin/git_remote_nostr/list.rs')
-rw-r--r--src/bin/git_remote_nostr/list.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bin/git_remote_nostr/list.rs b/src/bin/git_remote_nostr/list.rs
index 3614626..c8843e3 100644
--- a/src/bin/git_remote_nostr/list.rs
+++ b/src/bin/git_remote_nostr/list.rs
@@ -22,8 +22,8 @@ use repo_ref::RepoRef;
22use crate::{ 22use crate::{
23 git::Repo, 23 git::Repo,
24 utils::{ 24 utils::{
25 error_is_not_authentication_failure, get_open_proposals, get_read_protocols_to_try, 25 fetch_or_list_error_is_not_authentication_failure, get_open_proposals,
26 get_short_git_server_name, join_with_and, 26 get_read_protocols_to_try, get_short_git_server_name, join_with_and,
27 }, 27 },
28}; 28};
29 29
@@ -197,7 +197,9 @@ pub fn list_from_remote(
197 format!("list: {formatted_url} failed over {protocol}: {error}").as_str(), 197 format!("list: {formatted_url} failed over {protocol}: {error}").as_str(),
198 )?; 198 )?;
199 failed_protocols.push(protocol); 199 failed_protocols.push(protocol);
200 if protocol == &ServerProtocol::Ssh && error_is_not_authentication_failure(&error) { 200 if protocol == &ServerProtocol::Ssh
201 && fetch_or_list_error_is_not_authentication_failure(&error)
202 {
201 // authenticated by failed to complete request 203 // authenticated by failed to complete request
202 break; 204 break;
203 } 205 }