adjust: Fix some bad behavior when unlocked files use URL keys.
authorJoey Hess <joeyh@joeyh.name>
Mon, 25 Jan 2021 21:25:42 +0000 (17:25 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 25 Jan 2021 21:25:42 +0000 (17:25 -0400)
commit34a535ebeaf483f6643f949ae774939650d74837
tree647ca9a5ac8aa5c64f185ba3cd7c1ce944128a0e
parentdf70b307c4139b95672b22fb5102656d2b7df6b5
adjust: Fix some bad behavior when unlocked files use URL keys.

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.
Annex/Link.hs
CHANGELOG
Command/Smudge.hs