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:
Diffstat (limited to 'src/bin/git_remote_nostr/list.rs')
-rw-r--r--src/bin/git_remote_nostr/list.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/git_remote_nostr/list.rs b/src/bin/git_remote_nostr/list.rs
index c2bd9d6..959b8c8 100644
--- a/src/bin/git_remote_nostr/list.rs
+++ b/src/bin/git_remote_nostr/list.rs
@@ -24,6 +24,7 @@ use crate::{
24 utils::{ 24 utils::{
25 fetch_or_list_error_is_not_authentication_failure, get_open_proposals, 25 fetch_or_list_error_is_not_authentication_failure, get_open_proposals,
26 get_read_protocols_to_try, get_short_git_server_name, join_with_and, 26 get_read_protocols_to_try, get_short_git_server_name, join_with_and,
27 set_protocol_preference, Direction,
27 }, 28 },
28}; 29};
29 30
@@ -157,7 +158,7 @@ pub fn list_from_remote(
157 decoded_nostr_url: &NostrUrlDecoded, // Add this parameter 158 decoded_nostr_url: &NostrUrlDecoded, // Add this parameter
158) -> Result<HashMap<String, String>> { 159) -> Result<HashMap<String, String>> {
159 let server_url = git_server_url.parse::<CloneUrl>()?; 160 let server_url = git_server_url.parse::<CloneUrl>()?;
160 let protocols_to_attempt = get_read_protocols_to_try(&server_url, decoded_nostr_url); 161 let protocols_to_attempt = get_read_protocols_to_try(git_repo, &server_url, decoded_nostr_url);
161 162
162 let mut failed_protocols = vec![]; 163 let mut failed_protocols = vec![];
163 let mut remote_state: Option<HashMap<String, String>> = None; 164 let mut remote_state: Option<HashMap<String, String>> = None;
@@ -191,6 +192,8 @@ pub fn list_from_remote(
191 ) 192 )
192 .as_str(), 193 .as_str(),
193 )?; 194 )?;
195 let _ =
196 set_protocol_preference(git_repo, protocol, &server_url, &Direction::Fetch);
194 } 197 }
195 break; 198 break;
196 } 199 }