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

@ -16,6 +16,8 @@ git-annex (7.20181106) UNRELEASED; urgency=medium
to an exporttree remote that already contains the files.
* smudge: When passed a file located outside the working tree, eg by git
diff, avoid erroring out.
* drop -J: Avoid processing the same key twice at the same time when
multiple annexes files use it.
-- Joey Hess <id@joeyh.name> Tue, 06 Nov 2018 12:44:27 -0400

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) $