This commit is contained in:
voidlizard 2025-01-17 07:59:15 +03:00
parent 10ff2ceaff
commit 0405d111aa
2 changed files with 10 additions and 6 deletions

View File

@ -895,6 +895,11 @@ theDict = do
rrefs <- importedRefs
liftIO $ print $ pretty rrefs
entry $ bindMatch "reflog:imported" $ nil_ $ \syn -> lift $ connectedDo do
p <- importedCheckpoint
liftIO $ print $ pretty p
entry $ bindMatch "reflog:import" $ nil_ $ \syn -> lift $ connectedDo do
updateReflogIndex
@ -902,12 +907,8 @@ theDict = do
>>= orThrowUser "git directory not found"
<&> (</> "objects/pack")
state <- getStatePathM
sto <- getStorage
let imported = state </> "imported"
prev <- importedCheckpoint
excl <- maybe1 prev (pure mempty) $ \p -> do

View File

@ -392,7 +392,10 @@ importedCheckpoint = do
state <- getStatePathM
let imported = state </> "imported"
runMaybeT do
f <- liftIO (try @_ @IOError (readFile imported)) >>= toMPlus
f <- liftIO (try @_ @IOError (readFile imported <&> headMay . lines))
>>= toMPlus
>>= toMPlus
toMPlus (fromStringMay @HashRef f)
{- HLINT ignore "Functor law"-}
@ -439,5 +442,5 @@ updateImportedCheckpoint cp = do
state <- getStatePathM
let imported = state </> "imported"
liftIO $ UIO.withBinaryFileAtomic imported WriteMode $ \fh -> do
hPrint fh (show $ pretty cp)
hPrint fh (pretty cp)