sync --no-content import from directory special remote

sync: When run without --content, import without copying from
importtree=yes directory special remotes. (Other special remotes may
support this later as well.)

This commit was sponsored by Svenne Krap on Patreon.
This commit is contained in:
Joey Hess 2020-09-28 15:29:08 -04:00
parent 3eaaec3113
commit 658ea7ca3c
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 17 additions and 3 deletions

View file

@ -66,6 +66,7 @@ import Annex.UpdateInstead
import Annex.Export
import Annex.TaggedPush
import Annex.CurrentBranch
import Annex.Import (canImportKeys)
import Types.FileMatcher
import qualified Database.Export as Export
import Utility.Bloom
@ -468,8 +469,11 @@ importRemote importcontent o mergeconfig remote currbranch
let subdir = if S.null p
then Nothing
else Just (asTopFilePath p)
Command.Import.seekRemote remote branch subdir importcontent
void $ mergeRemote remote currbranch mergeconfig o
if canImportKeys remote importcontent
then do
Command.Import.seekRemote remote branch subdir importcontent
void $ mergeRemote remote currbranch mergeconfig o
else warning $ "Cannot import from " ++ Remote.name remote ++ " when not syncing content."
where
wantpull = remoteAnnexPull (Remote.gitconfig remote)