]> dgit.raspbian.org Git - git-annex.git/commit
prevent removeKey from annexobjects=yes remote when the key is in the exported tree
authorJoey Hess <joeyh@joeyh.name>
Fri, 2 Aug 2024 20:45:52 +0000 (16:45 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 2 Aug 2024 20:45:52 +0000 (16:45 -0400)
commit069d90eab52f99ea5966f459e28479216c510089
treee2b7a4277428d82a6aee6e34f0ae20ee2047f87a
parent28b29f63dc95f72e99ba65104e5a8e326eb4a14f
prevent removeKey from annexobjects=yes remote when the key is in the exported tree

Removing the key from the annexobjects location when it's in the
exported tree would leave it in the exported tree, and so succeeding
would update the location log incorrectly. But this also can't remove it
from the exported tree, because that would cause import tree to see a
file got deleted. So, refuse to remove in this situation.

It would be possible to remove from the annexobjects location and then
fail. Then if a key somehow got stored in both the annexobjects location
and the exported tree location(s), the duplicate would be resolved. Not
doing this because first, I don't know how that situation could happen,
and second, it seems wrong for a failed remove to have a side-effect
like that.
Remote/Helper/ExportImport.hs