refactoring
This commit is contained in:
parent
efae085272
commit
13423f337c
1 changed files with 9 additions and 7 deletions
|
@ -224,19 +224,21 @@ reconcileStaged qh = do
|
|||
gitindex <- inRepo currentIndexFile
|
||||
indexcache <- fromRawFilePath <$> fromRepo gitAnnexKeysDbIndexCache
|
||||
withTSDelta (liftIO . genInodeCache gitindex) >>= \case
|
||||
Just cur ->
|
||||
liftIO (maybe Nothing readInodeCache <$> catchMaybeIO (readFile indexcache)) >>= \case
|
||||
Nothing -> go cur indexcache =<< getindextree
|
||||
Just prev -> ifM (compareInodeCaches prev cur)
|
||||
( noop
|
||||
, go cur indexcache =<< getindextree
|
||||
)
|
||||
Just cur -> readindexcache indexcache >>= \case
|
||||
Nothing -> go cur indexcache =<< getindextree
|
||||
Just prev -> ifM (compareInodeCaches prev cur)
|
||||
( noop
|
||||
, go cur indexcache =<< getindextree
|
||||
)
|
||||
Nothing -> noop
|
||||
where
|
||||
lastindexref = Ref "refs/annex/last-index"
|
||||
|
||||
getindextree = inRepo writeTreeQuiet
|
||||
|
||||
readindexcache indexcache = liftIO $ maybe Nothing readInodeCache
|
||||
<$> catchMaybeIO (readFile indexcache)
|
||||
|
||||
getoldtree = fromMaybe emptyTree <$> inRepo (Git.Ref.sha lastindexref)
|
||||
|
||||
go cur indexcache (Just newtree) = do
|
||||
|
|
Loading…
Add table
Reference in a new issue