import: Check gitignores when importing trees from special remotes

It seemed best to do this, for consistency with every other way files can
get into a git-annex repo. Although it's just a bit strange that a local
.gitignore file affects the pseudo-commits made for the remote that's
imported from.

This commit was sponsored by Brett Eisenberg on Patreon.
This commit is contained in:
Joey Hess 2020-09-30 10:41:59 -04:00
parent 0033e08193
commit c56efbbdb6
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 46 additions and 29 deletions

View file

@ -67,6 +67,7 @@ import Annex.Export
import Annex.TaggedPush
import Annex.CurrentBranch
import Annex.Import (canImportKeys)
import Annex.CheckIgnore
import Types.FileMatcher
import qualified Database.Export as Export
import Utility.Bloom
@ -471,7 +472,7 @@ importRemote importcontent o mergeconfig remote currbranch
else Just (asTopFilePath p)
if canImportKeys remote importcontent
then do
Command.Import.seekRemote remote branch subdir importcontent
Command.Import.seekRemote remote branch subdir importcontent (CheckGitIgnore True)
void $ mergeRemote remote currbranch mergeconfig o
else warning $ "Cannot import from " ++ Remote.name remote ++ " when not syncing content."
where