remove inode cache in unannex
Similar to what commit 675556fd9a
did for
adding a non-annexed file, this prevents the smudge clean filter
recognising the inode if git add is later run on the unannexed file.
This commit is contained in:
parent
8dbbbc7250
commit
949627b902
2 changed files with 9 additions and 6 deletions
|
@ -141,9 +141,8 @@ addFile smallorlarge ci file = do
|
||||||
-- filter from being run. So the changes to the database
|
-- filter from being run. So the changes to the database
|
||||||
-- can be queued up and not flushed to disk immediately.
|
-- can be queued up and not flushed to disk immediately.
|
||||||
Small -> do
|
Small -> do
|
||||||
withTSDelta (liftIO . genInodeCache file) >>= \case
|
maybe noop Database.Keys.removeInodeCache
|
||||||
Just ic -> Database.Keys.removeInodeCache ic
|
=<< withTSDelta (liftIO . genInodeCache file)
|
||||||
Nothing -> return ()
|
|
||||||
return bypassSmudgeConfig
|
return bypassSmudgeConfig
|
||||||
Large -> return []
|
Large -> return []
|
||||||
Annex.Queue.addCommand cps "add" (ps++[Param "--"])
|
Annex.Queue.addCommand cps "add" (ps++[Param "--"])
|
||||||
|
|
|
@ -14,6 +14,8 @@ import Annex.Link
|
||||||
import qualified Annex.Queue
|
import qualified Annex.Queue
|
||||||
import Utility.CopyFile
|
import Utility.CopyFile
|
||||||
import qualified Database.Keys
|
import qualified Database.Keys
|
||||||
|
import Utility.InodeCache
|
||||||
|
import Annex.InodeSentinal
|
||||||
import Git.FilePath
|
import Git.FilePath
|
||||||
import qualified Utility.RawFilePath as R
|
import qualified Utility.RawFilePath as R
|
||||||
|
|
||||||
|
@ -55,17 +57,19 @@ perform file key = do
|
||||||
-- for key' (read from the symlink) to differ from key
|
-- for key' (read from the symlink) to differ from key
|
||||||
-- (cached in git).
|
-- (cached in git).
|
||||||
Just key' -> do
|
Just key' -> do
|
||||||
removeassociated
|
cleanupdb
|
||||||
next $ cleanup file key'
|
next $ cleanup file key'
|
||||||
-- If the file is unlocked, it can be unmodified or not and
|
-- If the file is unlocked, it can be unmodified or not and
|
||||||
-- does not need to be replaced either way.
|
-- does not need to be replaced either way.
|
||||||
Nothing -> do
|
Nothing -> do
|
||||||
removeassociated
|
cleanupdb
|
||||||
next $ return True
|
next $ return True
|
||||||
where
|
where
|
||||||
removeassociated =
|
cleanupdb = do
|
||||||
Database.Keys.removeAssociatedFile key
|
Database.Keys.removeAssociatedFile key
|
||||||
=<< inRepo (toTopFilePath file)
|
=<< inRepo (toTopFilePath file)
|
||||||
|
maybe noop Database.Keys.removeInodeCache
|
||||||
|
=<< withTSDelta (liftIO . genInodeCache file)
|
||||||
|
|
||||||
cleanup :: RawFilePath -> Key -> CommandCleanup
|
cleanup :: RawFilePath -> Key -> CommandCleanup
|
||||||
cleanup file key = do
|
cleanup file key = do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue