consistently use importKey when available
authorJoey Hess <joeyh@joeyh.name>
Mon, 28 Sep 2020 19:03:15 +0000 (15:03 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 28 Sep 2020 19:27:46 +0000 (15:27 -0400)
commit3eaaec3113d60fba4e29c6638c3d8199f0ca6b4e
treee59943b5c371dc34f6c15fa415b5862844ff6a84
parent15c1ee16d90b6c32bbbd5a625298c50b71da76cd
consistently use importKey when available

This avoids import with --no-content and with --content potentially
generating two different trees, leading to a merge conflict when run in
two different clones of a repo. And it's necessary groundwork to make
git-annex sync --no-content import from special remotes that support
importKey.

Only the directory special remote currently supports importKey, and it
generates the same key as git-annex usually does, so there is no
behavior change for it.

Future special remotes will need to take care when adding importKey,
if it generates different keys. Added some warnings about that to
comments.

This commit was sponsored by Noam Kremen on Patreon.
Annex/Import.hs
Command/Sync.hs
doc/design/external_special_remote_protocol/export_and_import_appendix.mdwn
doc/git-annex-import.mdwn
doc/git-annex-sync.mdwn
doc/todo/sync_fast_import.mdwn