From bbc1c7c342237c03554368abc15f5a3fbcd447f9 Mon Sep 17 00:00:00 2001 From: voidlizard Date: Thu, 5 Dec 2024 08:14:18 +0300 Subject: [PATCH] wip17, oopsie --- hbs2-git3/app/Main.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hbs2-git3/app/Main.hs b/hbs2-git3/app/Main.hs index c1add987..0409f0b6 100644 --- a/hbs2-git3/app/Main.hs +++ b/hbs2-git3/app/Main.hs @@ -661,6 +661,10 @@ export mref' r = connectedDo $ flip runContT pure do ExportProcessCommit co bs -> do debug $ "write pack for" <+> pretty co + l <- readTVarIO q<&> HPSQ.keys + + let lastBlock = co == r && L.null l + hhead <- gitRevParse co >>= orThrow (OtherGitError $ show $ "can't parse" <+> pretty co) @@ -690,7 +694,7 @@ export mref' r = connectedDo $ flip runContT pure do let ref = maybeToList $ EGitRef <$> mref <*> pure now <*> pure (Just co) - let seed = ref <> [EGitObject Commit co Nothing bs] + let seed = (if lastBlock then ref else mempty) <> [EGitObject Commit co Nothing bs] flip fix (EWAcc 1 r 0 seed) $ \go -> \case @@ -928,6 +932,12 @@ theDict = do putStrLn $ show $ "ref" <+> pretty ref <+> pretty w <+> pretty h pure True + entry $ bindMatch "test:git:cblock:scan" $ nil_ $ \case + [ HashLike cblock ] -> do + none + + _ -> throwIO (BadFormException @C nil) + entry $ bindMatch "test:git:tree:export" $ nil_ $ \syn -> lift do (w, r) <- case syn of [] -> (Nothing,) <$> gitRevParseThrow "HEAD"