smudge: check for known annexed inodes before checking annex.largefiles
authorJoey Hess <joeyh@joeyh.name>
Mon, 3 May 2021 17:23:19 +0000 (13:23 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 3 May 2021 17:26:32 +0000 (13:26 -0400)
commit424bef6b6f43ba9e09b61faa337fc6c9104e1a1f
tree998f3d7f04bf2647b4096c7cb1bad08ad574f314
parentf2876804ca3d125caa95dadd522256b76549bb52
smudge: check for known annexed inodes before checking annex.largefiles

smudge: Fix a case where an unlocked annexed file that annex.largefiles
does not match could get its unchanged content checked into git, due to git
running the smudge filter unecessarily.

When the file has the same inodecache as an already annexed file,
we can assume that the user is not intending to change how it's stored in
git.

Note that checkunchangedgitfile already handled the inverse case, where the
file was added to git previously. That goes further and actually sha1
hashes the new file and checks if it's the same hash in the index.

It would be possible to generate a key for the file and see if it's the
same as the old key, however that could be considerably more expensive than
sha1 of a small file is, and it is not necessary for the case I have, at
least, where the file is not modified or touched, and so its inode will
match the cache.
CHANGELOG
Command/Smudge.hs
doc/forum/one-off_unlocked_annex_files_that_go_against_large/comment_2_9bd32b89d0521fd1bec94683dffb4ecd._comment [new file with mode: 0644]