From f0869cb1e98c574deecb350f8e879e1be39de94b Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Wed, 5 Jun 2024 18:00:29 +0200 Subject: allow absolute file names --- src/Store/Store.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Store/Store.hs') diff --git a/src/Store/Store.hs b/src/Store/Store.hs index 1ec59ef..b55c56d 100644 --- a/src/Store/Store.hs +++ b/src/Store/Store.hs @@ -171,7 +171,7 @@ readFile' :: (G.BlobOid GB.LgRepo -> ReaderT GB.LgRepo IO a) -> FilePath -> StoreM a -readFile' cat fp = do +readFile' cat (makeRelative "/" -> fp) = do State {tid} <- get Env {repo} <- ask lift $ G.runRepository GB.lgFactory repo do @@ -187,7 +187,7 @@ readFile' cat fp = do =<< G.treeEntry tree (B.fromString fp) writeFile :: FilePath -> LB.ByteString -> StoreM () -writeFile (B.fromString -> fp) v = do +writeFile (B.fromString . makeRelative "/" -> fp) v = do State {tid} <- get Env {repo} <- ask tid' <- lift $ G.runRepository GB.lgFactory repo do @@ -197,7 +197,7 @@ writeFile (B.fromString -> fp) v = do modify $ \s -> s {tid = tid'} deleteFile :: FilePath -> StoreM () -deleteFile (B.fromString -> fp) = do +deleteFile (B.fromString . makeRelative "/" -> fp) = do State {tid} <- get Env {repo} <- ask tid' <- lift $ G.runRepository GB.lgFactory repo do -- cgit v1.2.3