upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/git_remote_nostr/utils.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/git_remote_nostr/utils.rs')
-rw-r--r--src/bin/git_remote_nostr/utils.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bin/git_remote_nostr/utils.rs b/src/bin/git_remote_nostr/utils.rs
index a31dcbf..90ea848 100644
--- a/src/bin/git_remote_nostr/utils.rs
+++ b/src/bin/git_remote_nostr/utils.rs
@@ -282,6 +282,7 @@ pub fn get_read_protocols_to_try(
282 vec![ 282 vec![
283 ServerProtocol::UnauthHttp, 283 ServerProtocol::UnauthHttp,
284 ServerProtocol::Ssh, 284 ServerProtocol::Ssh,
285 // note: list and fetch stop here if ssh was authenticated
285 ServerProtocol::Http, 286 ServerProtocol::Http,
286 ] 287 ]
287 } else if server_url.protocol() == ServerProtocol::Ftp { 288 } else if server_url.protocol() == ServerProtocol::Ftp {
@@ -290,11 +291,17 @@ pub fn get_read_protocols_to_try(
290 vec![ 291 vec![
291 ServerProtocol::UnauthHttps, 292 ServerProtocol::UnauthHttps,
292 ServerProtocol::Ssh, 293 ServerProtocol::Ssh,
294 // note: list and fetch stop here if ssh was authenticated
293 ServerProtocol::Https, 295 ServerProtocol::Https,
294 ] 296 ]
295 } 297 }
296} 298}
297 299
300pub fn error_is_not_authentication_failure(error: &anyhow::Error) -> bool {
301 let error_str = error.to_string();
302 error_str.contains("Permission to") || error_str.contains("Repository not found")
303}
304
298#[cfg(test)] 305#[cfg(test)]
299mod tests { 306mod tests {
300 use super::*; 307 use super::*;