aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/main.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/src/main.rs b/server/src/main.rs
index 0f12c8f..2df42dd 100644
--- a/server/src/main.rs
+++ b/server/src/main.rs
@@ -740,6 +740,7 @@ fn forwarded_from_trusted_host(
740 } 740 }
741 Ok(false) 741 Ok(false)
742} 742}
743
743const REPO_NOT_FOUND: GitLfsErrorResponse = 744const REPO_NOT_FOUND: GitLfsErrorResponse =
744 make_error_resp(StatusCode::NOT_FOUND, "Repository not found"); 745 make_error_resp(StatusCode::NOT_FOUND, "Repository not found");
745 746
@@ -796,10 +797,11 @@ fn is_repo_public(name: &str) -> Option<bool> {
796 if !repo_exists(name) { 797 if !repo_exists(name) {
797 return None; 798 return None;
798 } 799 }
799 std::fs::metadata(format!("{name}/git-daemon-export-ok")) 800 match std::fs::metadata(format!("{name}/git-daemon-export-ok")) {
800 .ok()? 801 Ok(metadata) if metadata.is_file() => Some(true),
801 .is_file() 802 Err(e) if e.kind() == std::io::ErrorKind::NotFound => Some(false),
802 .into() 803 _ => None,
804 }
803} 805}
804 806
805async fn batch( 807async fn batch(