diff options
Diffstat (limited to 'app/Main.hs')
-rw-r--r-- | app/Main.hs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/app/Main.hs b/app/Main.hs index 47f0280..9f04849 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -13,10 +13,8 @@ import Data.List (foldl', isSuffixOf) import Data.Maybe (fromMaybe, mapMaybe) import Data.Set qualified as S import Data.String (IsString (fromString)) -import Data.Tagged (Tagged (Tagged)) import Data.Text qualified as T import Debug.Trace (trace) -import Git import Store qualified as S import System.Directory (setCurrentDirectory) import System.FilePath ((</>)) @@ -146,9 +144,8 @@ query (Select fs c js ws) = do where ls c = filter (not . (isSuffixOf "/")) - <$> S.withStore "." do - Just cid <- fmap Tagged <$> resolveReference "HEAD" - S.listDirectory cid c + <$> S.withStore "." "HEAD" do + S.listDirectory c combine :: [Record J.Value] -> [Join [Record J.Value]] -> [[Record J.Value]] combine vs js = combine' (map (: []) vs) js @@ -197,9 +194,8 @@ data DecodeException = DecodeException instance Exception DecodeException decodeFile :: J.FromJSON a => FilePath -> IO a -decodeFile fp = S.withStore "." do - Just cid <- fmap Tagged <$> resolveReference "HEAD" - fromMaybe (throw DecodeException) . J.decode <$> S.readFile cid fp +decodeFile fp = S.withStore "." "HEAD" do + fromMaybe (throw DecodeException) . J.decode <$> S.readFile fp select :: FieldSelector -> [Record J.Value] -> J.Value select All vs = |