diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-05-09 20:00:24 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-05-09 20:00:24 +0100 |
| commit | 38969bbfadf2854f6acb1e515f8f388a01a018c2 (patch) | |
| tree | e5d3758003559bb5f82a4ba6bd455ae18463646c /src/bin/git_remote_nostr/fetch.rs | |
| parent | 2e5e6a5c860b9bdbd8fa3a495b68a8478fbad4cc (diff) | |
fix: always try git servers over other protocols
remove the code that guessed whether it was an authentication failure
and gave up is it wasn't. this prevents it from trying http for push
when ssh is not supported eg. ngit-relay
Diffstat (limited to 'src/bin/git_remote_nostr/fetch.rs')
| -rw-r--r-- | src/bin/git_remote_nostr/fetch.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/bin/git_remote_nostr/fetch.rs b/src/bin/git_remote_nostr/fetch.rs index a7210d0..34a02fc 100644 --- a/src/bin/git_remote_nostr/fetch.rs +++ b/src/bin/git_remote_nostr/fetch.rs | |||
| @@ -24,8 +24,7 @@ use nostr::nips::nip19; | |||
| 24 | use nostr_sdk::{Event, ToBech32}; | 24 | use nostr_sdk::{Event, ToBech32}; |
| 25 | 25 | ||
| 26 | use crate::utils::{ | 26 | use crate::utils::{ |
| 27 | Direction, fetch_or_list_error_is_not_authentication_failure, | 27 | Direction, find_proposal_and_patches_by_branch_name, get_oids_from_fetch_batch, |
| 28 | find_proposal_and_patches_by_branch_name, get_oids_from_fetch_batch, | ||
| 29 | get_open_or_draft_proposals, get_read_protocols_to_try, join_with_and, set_protocol_preference, | 28 | get_open_or_draft_proposals, get_read_protocols_to_try, join_with_and, set_protocol_preference, |
| 30 | }; | 29 | }; |
| 31 | 30 | ||
| @@ -196,12 +195,6 @@ pub fn fetch_from_git_server( | |||
| 196 | format!("fetch: {formatted_url} failed over {protocol}: {error}").as_str(), | 195 | format!("fetch: {formatted_url} failed over {protocol}: {error}").as_str(), |
| 197 | )?; | 196 | )?; |
| 198 | failed_protocols.push(protocol); | 197 | failed_protocols.push(protocol); |
| 199 | if protocol == &ServerProtocol::Ssh | ||
| 200 | && fetch_or_list_error_is_not_authentication_failure(&error) | ||
| 201 | { | ||
| 202 | // authenticated by failed to complete request | ||
| 203 | break; | ||
| 204 | } | ||
| 205 | } else { | 198 | } else { |
| 206 | success = true; | 199 | success = true; |
| 207 | if !failed_protocols.is_empty() { | 200 | if !failed_protocols.is_empty() { |