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.
This commit is contained in:
Joey Hess 2017-10-16 14:10:03 -04:00
parent a461cf2ce6
commit 85ed38a574
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
25 changed files with 128 additions and 71 deletions

View file

@ -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