check onlyActionOn in Drop

* drop -J: Avoid processing the same key twice at the same time when
  multiple annexes files use it.

This prevents a drop of a key conflicting with another drop of the same
key.

This commit was sponsored by Brock Spratlen on Patreon.
This commit is contained in:
Joey Hess 2018-11-15 15:43:51 -04:00
parent 370757087d
commit c8bd5710b1
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 3 additions and 1 deletions

View file

@ -68,7 +68,7 @@ start o file key = start' o key afile (mkActionItem afile)
afile = AssociatedFile (Just file)
start' :: DropOptions -> Key -> AssociatedFile -> ActionItem -> CommandStart
start' o key afile ai = do
start' o key afile ai = onlyActionOn key $ do
from <- maybe (pure Nothing) (Just <$$> getParsed) (dropFrom o)
checkDropAuto (autoMode o) from afile key $ \numcopies ->
stopUnless (want from) $