found a way to extract InodeCache from git index

This will allow a race-free database transition. It is somewhat hairy in
that it depends on an unspecified git output format.
This commit is contained in:
Joey Hess 2019-11-06 14:23:00 -04:00
parent 6147130e86
commit 89bdcffdfa
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 87 additions and 9 deletions

View file

@ -12,6 +12,7 @@
module Utility.InodeCache (
InodeCache,
mkInodeCache,
InodeComparisonType(..),
inodeCacheFileSize,
@ -61,6 +62,10 @@ data InodeCachePrim = InodeCachePrim FileID FileSize MTime
newtype InodeCache = InodeCache InodeCachePrim
deriving (Show)
mkInodeCache :: FileID -> FileSize -> POSIXTime -> InodeCache
mkInodeCache inode sz mtime = InodeCache $
InodeCachePrim inode sz (MTimeHighRes mtime)
inodeCacheFileSize :: InodeCache -> FileSize
inodeCacheFileSize (InodeCache (InodeCachePrim _ sz _)) = sz