RawFilePath optimisations
authorJoey Hess <joeyh@joeyh.name>
Wed, 22 Jun 2022 20:20:08 +0000 (16:20 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 22 Jun 2022 20:20:08 +0000 (16:20 -0400)
Annex/Content.hs
Annex/Content/PointerFile.hs
Command/Fsck.hs

index 6e31ef0ea5b8bb7c006cec929d8d34fb8ea341b1..754127bd5512d0036139c4946b05f8f10d7afb12 100644 (file)
@@ -898,12 +898,12 @@ getKeyStatus key = catchDefaultIO KeyMissing $ do
                then KeyUnlockedThin
                else KeyPresent
 
-getKeyFileStatus :: Key -> FilePath -> Annex KeyStatus
+getKeyFileStatus :: Key -> RawFilePath -> Annex KeyStatus
 getKeyFileStatus key file = do
        s <- getKeyStatus key
        case s of
                KeyUnlockedThin -> catchDefaultIO KeyUnlockedThin $
-                       ifM (isJust <$> isAnnexLink (toRawFilePath file))
+                       ifM (isJust <$> isAnnexLink file)
                                ( return KeyLockedThin
                                , return KeyUnlockedThin
                                )
index 10a6b3b2cc270dfd96946f2ad55827b840e1a0ce..8d3edf6bd0a554277a6ba91c6769f6da95a8db7f 100644 (file)
@@ -68,5 +68,5 @@ depopulatePointerFile key file = do
                        (\t -> touch tmp' t False)
                        (fmap Posix.modificationTimeHiRes st)
 #endif
-               withTSDelta (liftIO . genInodeCache (toRawFilePath tmp))
+               withTSDelta (liftIO . genInodeCache tmp')
        maybe noop (restagePointerFile (Restage True) file) ic
index f34640b087621f4a39d01ab81489b4b3f293608a..d93c6f17077f92178e15cb81cefff55226e58b16 100644 (file)
@@ -132,7 +132,7 @@ start from inc si file key = Backend.getBackend (fromRawFilePath file) key >>= \
 
 perform :: Key -> RawFilePath -> Backend -> NumCopies -> Annex Bool
 perform key file backend numcopies = do
-       keystatus <- getKeyFileStatus key (fromRawFilePath file)
+       keystatus <- getKeyFileStatus key file
        check
                -- order matters
                [ fixLink key file