liftIO $ moveFile
(fromRawFilePath src)
(fromRawFilePath dest)
- 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)
+ 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)
)
alreadyhave = liftIO $ R.removeLink src
cleanObjectLoc key $ do
secureErase file
liftIO $ removeWhenExistsWith R.removeLink file
- g <- Annex.gitRepo
- mapM_ (\f -> void $ tryIO $ resetpointer $ fromTopFilePath f g)
- =<< Database.Keys.getAssociatedFiles key
- Database.Keys.removeInodeCaches key
+ whenM (annexSupportUnlocked <$> Annex.getGitConfig) $ do
+ 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.
{- Copy to any unlocked files using the same key. -}
populateUnlockedFiles :: Key -> KeySource -> Restage -> Annex ()
-populateUnlockedFiles key source restage = do
- obj <- calcRepo (gitAnnexLocation key)
- g <- Annex.gitRepo
- ingestedf <- flip fromTopFilePath g
- <$> inRepo (toTopFilePath (keyFilename source))
- afs <- map (`fromTopFilePath` g) <$> Database.Keys.getAssociatedFiles key
- forM_ (filter (/= ingestedf) afs) $
- populatePointerFile restage key obj
+populateUnlockedFiles key source restage =
+ whenM (annexSupportUnlocked <$> Annex.getGitConfig) $ do
+ obj <- calcRepo (gitAnnexLocation key)
+ g <- Annex.gitRepo
+ ingestedf <- flip fromTopFilePath g
+ <$> inRepo (toTopFilePath (keyFilename source))
+ afs <- map (`fromTopFilePath` g) <$> Database.Keys.getAssociatedFiles key
+ forM_ (filter (/= ingestedf) afs) $
+ populatePointerFile restage key obj
cleanCruft :: KeySource -> Annex ()
cleanCruft source = when (contentLocation source /= keyFilename source) $
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 28"""
+ date="2021-06-14T16:31:26Z"
+ content="""
+@Ilya sure can be skipped when annex.supportunlocked=false.
+I've implemented that. (And also for several other cases that have similar
+behavior, like dropping a key.)
+"""]]
used. --[[Joey]]
The easy things have been moved now, but some things like Annex.force and
-Annex.fast would be good to move. Moving those would involve running
-argument processing outside the Annex monad. The main reason argument
-processing runs in the Annex monad is to set those values, but there may be
-other reasons too, so this will be a large set of changes that need to all
-happen together. --[[Joey]]
+Annex.fast and Annex.getGitConfig would be good to move. Moving those would
+involve running argument processing outside the Annex monad. The main
+reason argument processing runs in the Annex monad is to set those values,
+but there may be other reasons too, so this will be a large set of changes
+that need to all happen together. --[[Joey]]