summaryrefslogtreecommitdiff
path: root/Command/Drop.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-03-10 13:12:24 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-03-10 13:35:31 -0400
commit8cb9381befed4174624edfc80e09185c9340b4f6 (patch)
treee5d2041ff38502b1f8a5ef9caa6515cccfcea555 /Command/Drop.hs
parente230fd58b5f5d5d16f87e1bd5c0f2e553f2ae5a2 (diff)
AssociatedFile newtype
To prevent any further mistakes like 1a497cefb47557f0b4788c606f9071be422b2511 This commit was sponsored by Francois Marier on Patreon.
Diffstat (limited to 'Command/Drop.hs')
-rw-r--r--Command/Drop.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Command/Drop.hs b/Command/Drop.hs
index 129dce035..52b89b82c 100644
--- a/Command/Drop.hs
+++ b/Command/Drop.hs
@@ -65,7 +65,7 @@ seek o = allowConcurrentOutput $
start :: DropOptions -> FilePath -> Key -> CommandStart
start o file key = start' o key afile (mkActionItem afile)
where
- afile = Just file
+ afile = AssociatedFile (Just file)
start' :: DropOptions -> Key -> AssociatedFile -> ActionItem -> CommandStart
start' o key afile ai = do
@@ -85,7 +85,7 @@ start' o key afile ai = do
| otherwise = return True
startKeys :: DropOptions -> Key -> ActionItem -> CommandStart
-startKeys o key = start' o key Nothing
+startKeys o key = start' o key (AssociatedFile Nothing)
startLocal :: AssociatedFile -> ActionItem -> NumCopies -> Key -> [VerifiedCopy] -> CommandStart
startLocal afile ai numcopies key preverified = stopUnless (inAnnex key) $ do
@@ -202,7 +202,8 @@ requiredContent = do
{- In auto mode, only runs the action if there are enough
- copies on other semitrusted repositories. -}
checkDropAuto :: Bool -> Maybe Remote -> AssociatedFile -> Key -> (NumCopies -> CommandStart) -> CommandStart
-checkDropAuto automode mremote afile key a = go =<< maybe getNumCopies getFileNumCopies afile
+checkDropAuto automode mremote (AssociatedFile afile) key a =
+ go =<< maybe getNumCopies getFileNumCopies afile
where
go numcopies
| automode = do