diff options
Diffstat (limited to 'src/bin/git_remote_nostr/utils.rs')
| -rw-r--r-- | src/bin/git_remote_nostr/utils.rs | 7 |
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 | ||
| 300 | pub 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)] |
| 299 | mod tests { | 306 | mod tests { |
| 300 | use super::*; | 307 | use super::*; |