mygit

[UNMAINTAINED] A cgit/webgit alternative, written in Rust
Log | Files | Refs | README | LICENSE

commit 54943b05770ddabe3d9f63d401c13b2fa7407ca0
parent b782ba28bb4c7f94777c879651ae5852cf152a66
Author: Johann150 <johann@qwertqwefsday.eu>
Date:   Sun, 14 Mar 2021 23:55:34 +0100

check for export file

Diffstat:
Msrc/main.rs | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs @@ -39,7 +39,12 @@ async fn index(req: Request<()>) -> tide::Result { .map(|entries| { entries .filter_map(|entry| Some(entry.ok()?.path())) - // TODO check for git-daemon-export-ok file + .filter(|entry| { + // check for the export file + let mut path = entry.clone(); + path.push("git-daemon-export-ok"); + path.exists() + }) .filter_map(|entry| Repository::open(entry).ok()) .collect::<Vec<_>>() })