upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/git_remote_nostr/fetch.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/fetch.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/fetch.rs')
-rw-r--r--src/bin/git_remote_nostr/fetch.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bin/git_remote_nostr/fetch.rs b/src/bin/git_remote_nostr/fetch.rs
index c48da85..83b94b8 100644
--- a/src/bin/git_remote_nostr/fetch.rs
+++ b/src/bin/git_remote_nostr/fetch.rs
@@ -15,7 +15,7 @@ use ngit::{
15}; 15};
16 16
17use crate::utils::{ 17use crate::utils::{
18 error_is_not_authentication_failure, find_proposal_and_patches_by_branch_name, 18 fetch_or_list_error_is_not_authentication_failure, find_proposal_and_patches_by_branch_name,
19 get_oids_from_fetch_batch, get_open_proposals, get_read_protocols_to_try, join_with_and, 19 get_oids_from_fetch_batch, get_open_proposals, get_read_protocols_to_try, join_with_and,
20}; 20};
21 21
@@ -140,7 +140,9 @@ fn fetch_from_git_server(
140 format!("fetch: {formatted_url} failed over {protocol}: {error}").as_str(), 140 format!("fetch: {formatted_url} failed over {protocol}: {error}").as_str(),
141 )?; 141 )?;
142 failed_protocols.push(protocol); 142 failed_protocols.push(protocol);
143 if protocol == &ServerProtocol::Ssh && error_is_not_authentication_failure(&error) { 143 if protocol == &ServerProtocol::Ssh
144 && fetch_or_list_error_is_not_authentication_failure(&error)
145 {
144 // authenticated by failed to complete request 146 // authenticated by failed to complete request
145 break; 147 break;
146 } 148 }