liftIO $ moveFile
(fromRawFilePath src)
(fromRawFilePath dest)
- whenM (annexSupportUnlocked <$> Annex.getGitConfig) $ do
- g <- Annex.gitRepo
- fs <- map (`fromTopFilePath` g)
- <$> Database.Keys.getAssociatedFiles key
- unless (null fs) $ do
- ics <- mapM (populatePointerFile (Restage True) key dest) fs
- Database.Keys.storeInodeCaches' key [dest] (catMaybes ics)
+ g <- Annex.gitRepo
+ fs <- map (`fromTopFilePath` g)
+ <$> Database.Keys.getAssociatedFiles key
+ unless (null fs) $ do
+ ics <- mapM (populatePointerFile (Restage True) key dest) fs
+ Database.Keys.storeInodeCaches' key [dest] (catMaybes ics)
)
alreadyhave = liftIO $ R.removeLink src
cleanObjectLoc key $ do
secureErase file
liftIO $ removeWhenExistsWith R.removeLink file
- whenM (annexSupportUnlocked <$> Annex.getGitConfig) $ do
- g <- Annex.gitRepo
- mapM_ (\f -> void $ tryIO $ resetpointer $ fromTopFilePath f g)
- =<< Database.Keys.getAssociatedFiles key
- Database.Keys.removeInodeCaches key
+ g <- Annex.gitRepo
+ mapM_ (\f -> void $ tryIO $ resetpointer $ fromTopFilePath f g)
+ =<< Database.Keys.getAssociatedFiles key
+ Database.Keys.removeInodeCaches key
where
-- Check associated pointer file for modifications, and reset if
-- it's unmodified.
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 33"""
+ date="2021-06-15T13:01:04Z"
+ content="""
+Oh, there's a much better solution: If the annex object file already exists
+when ingesting a new file, skip populating other associated files. They
+will have already been populated. moveAnnex has to check if the annex object
+file already exists anyway, so this will have zero overhead.
+"""]]