import Annex.NumCopies
cmd :: Command
-cmd = withGlobalOptions fileMatchingOptions $ notBareRepo $
+cmd = withGlobalOptions (jobsOption : fileMatchingOptions) $ notBareRepo $
command "import" SectionCommon
"move and add files from outside git working copy"
paramPaths (seek <$$> optParser)
)
seek :: ImportOptions -> CommandSeek
-seek o = do
+seek o = allowConcurrentOutput $ do
repopath <- liftIO . absPath =<< fromRepo Git.repoPath
inrepops <- liftIO $ filter (dirContains repopath) <$> mapM absPath (importFiles o)
unless (null inrepops) $ do
v <- Git.Version.installed
return $ v >= Git.Version.normalize "1.8.4"
+{- For some reason, check-ignore --batch always exits nonzero,
+ - so ignore any error. -}
checkIgnoreStop :: CheckIgnoreHandle -> IO ()
-checkIgnoreStop = CoProcess.stop
+checkIgnoreStop = void . tryIO . CoProcess.stop
{- Returns True if a file is ignored. -}
checkIgnored :: CheckIgnoreHandle -> FilePath -> IO Bool
git annex import /dir --include='*.png'
+* `--jobs=N` `-JN`
+
+ Imports multiple files in parallel. This may be faster.
+ For example: `-J4`
+
# CAVEATS
Note that using `--deduplicate` or `--clean-duplicates` with the WORM