mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
10ff2ceaff
commit
0405d111aa
|
@ -895,6 +895,11 @@ theDict = do
|
||||||
rrefs <- importedRefs
|
rrefs <- importedRefs
|
||||||
liftIO $ print $ pretty rrefs
|
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
|
entry $ bindMatch "reflog:import" $ nil_ $ \syn -> lift $ connectedDo do
|
||||||
updateReflogIndex
|
updateReflogIndex
|
||||||
|
|
||||||
|
@ -902,12 +907,8 @@ theDict = do
|
||||||
>>= orThrowUser "git directory not found"
|
>>= orThrowUser "git directory not found"
|
||||||
<&> (</> "objects/pack")
|
<&> (</> "objects/pack")
|
||||||
|
|
||||||
state <- getStatePathM
|
|
||||||
|
|
||||||
sto <- getStorage
|
sto <- getStorage
|
||||||
|
|
||||||
let imported = state </> "imported"
|
|
||||||
|
|
||||||
prev <- importedCheckpoint
|
prev <- importedCheckpoint
|
||||||
|
|
||||||
excl <- maybe1 prev (pure mempty) $ \p -> do
|
excl <- maybe1 prev (pure mempty) $ \p -> do
|
||||||
|
|
|
@ -392,7 +392,10 @@ importedCheckpoint = do
|
||||||
state <- getStatePathM
|
state <- getStatePathM
|
||||||
let imported = state </> "imported"
|
let imported = state </> "imported"
|
||||||
runMaybeT do
|
runMaybeT do
|
||||||
f <- liftIO (try @_ @IOError (readFile imported)) >>= toMPlus
|
f <- liftIO (try @_ @IOError (readFile imported <&> headMay . lines))
|
||||||
|
>>= toMPlus
|
||||||
|
>>= toMPlus
|
||||||
|
|
||||||
toMPlus (fromStringMay @HashRef f)
|
toMPlus (fromStringMay @HashRef f)
|
||||||
|
|
||||||
{- HLINT ignore "Functor law"-}
|
{- HLINT ignore "Functor law"-}
|
||||||
|
@ -439,5 +442,5 @@ updateImportedCheckpoint cp = do
|
||||||
state <- getStatePathM
|
state <- getStatePathM
|
||||||
let imported = state </> "imported"
|
let imported = state </> "imported"
|
||||||
liftIO $ UIO.withBinaryFileAtomic imported WriteMode $ \fh -> do
|
liftIO $ UIO.withBinaryFileAtomic imported WriteMode $ \fh -> do
|
||||||
hPrint fh (show $ pretty cp)
|
hPrint fh (pretty cp)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue