From 58e1cf274e80d8dbd4889bb2c99d3a009b590282 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Tue, 17 Dec 2024 21:36:55 +0100 Subject: restrict `listFiles` to paths --- src/Store/Store.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Store/Store.hs b/src/Store/Store.hs index 59a3ebf..134c8c3 100644 --- a/src/Store/Store.hs +++ b/src/Store/Store.hs @@ -32,7 +32,7 @@ import Data.Time.Clock (getCurrentTime) import Foreign import Git qualified as G import Git.Libgit2 qualified as GB -import System.FilePath (makeRelative, normalise, ()) +import System.FilePath (addTrailingPathSeparator, makeRelative, normalise, ()) import Text.Printf (printf) import Prelude hiding (readFile, writeFile) @@ -92,7 +92,7 @@ withCommit cid action = do (Env {repo, ref}) listFiles :: FilePath -> StoreM [FilePath] -listFiles (normalise . ("/" ) -> fp) = do +listFiles (normalise . ("/" ) . addTrailingPathSeparator -> fp) = do State {tid} <- get map (makeRelative fp) . filter (fp `isPrefixOf`) -- cgit v1.2.3