This avoids the smudge --clean filter failing on the URL keys.
git checkout runs the post-checkout hook, which runs smudge --update.
That populates all the pointer files, but it neglected to store their inode
caches in the keys db. With that done, and the keys db flushed before
smudge --clean gets run (by restagePointerFile), the isUnmodifiedCheap
check can tell the file is not modified, so will not try to re-ingest it,
which does not work with URL keys because they do not support genKey.
It also seems possible that the isUnmodifiedCheap was also failing for
non-URL keys, which would cause them to be re-ingested, leading to a lot of
extra work. I have not verified that, but don't see why it wouldn't have
happened. So this probably also speeds up checking out adjusted branches.
This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
import Utility.InodeCache
import Utility.Tmp.Dir
import Utility.CopyFile
+import qualified Database.Keys.Handle
import qualified Utility.RawFilePath as R
import qualified Data.ByteString as S
-- updated index file.
runner :: Git.Queue.InternalActionRunner Annex
runner = Git.Queue.InternalActionRunner "restagePointerFile" $ \r l -> do
+ liftIO . Database.Keys.Handle.flushDbQueue
+ =<< Annex.getState Annex.keysdbhandle
realindex <- liftIO $ Git.Index.currentIndexFile r
let lock = fromRawFilePath (Git.Index.indexFileLock realindex)
lockindex = liftIO $ catchMaybeIO $ Git.LockFile.openLock' lock
* Fix a bug that prevented git-annex init from working in a submodule.
* Fix a bug in view filename generation when a metadata value ended with
"/" (or ":" or "\" on Windows)
+ * adjust: Fix some bad behavior when unlocked files use URL keys.
-- Joey Hess <id@joeyh.name> Mon, 04 Jan 2021 12:52:41 -0400
f <- fromRepo (fromTopFilePath topf)
whenM (inAnnex k) $ do
obj <- calcRepo (gitAnnexLocation k)
- unlessM (isJust <$> populatePointerFile restage k obj f) $
- liftIO (isPointerFile f) >>= \case
+ populatePointerFile restage k obj f >>= \case
+ Just ic -> Database.Keys.addInodeCaches k [ic]
+ Nothing -> liftIO (isPointerFile f) >>= \case
Just k' | k' == k -> toplevelWarning False $
"unable to populate worktree file " ++ fromRawFilePath f
_ -> noop