💾 Archived View for lists.flounder.online › patches › threads › 20210314225537.23237-3-johann@qwertq… captured on 2022-04-28 at 19:25:35. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

[PATCH mygit 2/5] check for export file

[PATCH mygit 2/5] check for export file

From: johann@qwertqwefsday.eu

Date: Sun, 14 Mar 2021 23:55:34 +0100

Message-Id: 20210314225537.23237-3-johann@qwertqwefsday.eu

To: <~aw/patches@lists.sr.ht>

In-Reply-To: 20210314225537.23237-1-johann@qwertqwefsday.eu

Cc: "Johann150" <johann@qwertqwefsday.eu>

Reply

Export

--------------------------------------

From: Johann150 <johann@qwertqwefsday.eu>

---

src/main.rs | 7 ++++++-

1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs

index 11c2be2..0d1f074 100644

--- 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<_>>()

})

--

2.20.1