summaryrefslogtreecommitdiff
path: root/Command/Add.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-10-16 14:10:03 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-10-16 14:10:20 -0400
commit95697161487c5df3d8a88cdccbc40fd0c4d7b094 (patch)
tree7fb5769ee098ddafb445e587f550a22c4f1f49c9 /Command/Add.hs
parentfb899e75cf1ac84f3fd61ea39288811bacddee2c (diff)
Avoid repeated checking that files passed on the command line exist.
git annex add, git annex lock etc make multiple seek passes, and each seek pass checked that files existed. That was unncessary redundant work. Fixed by adding a new WorkTreeItem type, make seek actions use it, and check that the files exist when constructing it. This commit was supported by the NSF-funded DataLad project.
Diffstat (limited to 'Command/Add.hs')
-rw-r--r--Command/Add.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index beea48e0b..d1b2fbc7d 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -63,7 +63,8 @@ seek o = allowConcurrentOutput $ do
giveup "--update --batch is not supported"
| otherwise -> batchFiles gofile
NoBatch -> do
- let go a = a gofile (addThese o)
+ l <- workTreeItems (addThese o)
+ let go a = a gofile l
unless (updateOnly o) $
go (withFilesNotInGit (not $ includeDotFiles o))
go withFilesMaybeModified