summaryrefslogtreecommitdiff
path: root/Command.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-04-01 15:20:42 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-04-01 15:20:42 -0400
commitedaf2c14ac6bcae30832afcdb41f32350c8d0b0a (patch)
tree564eeef4f1032d01fac198640758ae91c050f464 /Command.hs
parente2a493f1f10a77c27bea400b8745f09cf01f5859 (diff)
drop --auto: Fix bug that prevented dropping files from untrusted repositories.
This is a corresponding bug to the one I fixed yesterday in the assistant.
Diffstat (limited to 'Command.hs')
-rw-r--r--Command.hs21
1 files changed, 0 insertions, 21 deletions
diff --git a/Command.hs b/Command.hs
index 5c1395ed7..06126103b 100644
--- a/Command.hs
+++ b/Command.hs
@@ -20,7 +20,6 @@ module Command (
isBareRepo,
numCopies,
numCopiesCheck,
- autoCopiesWith,
checkAuto,
module ReExported
) where
@@ -109,26 +108,6 @@ numCopiesCheck file key vs = do
have <- trustExclude UnTrusted =<< Remote.keyLocations key
return $ length have `vs` needed
-{- Used for commands that have an auto mode that checks the number of known
- - copies of a key.
- -
- - In auto mode, first checks that the number of known
- - copies of the key is > or < than the numcopies setting, before running
- - the action.
- -}
-autoCopiesWith :: FilePath -> Key -> (Int -> Int -> Bool) -> (Maybe Int -> CommandStart) -> CommandStart
-autoCopiesWith file key vs a = do
- numcopiesattr <- numCopies file
- Annex.getState Annex.auto >>= auto numcopiesattr
- where
- auto numcopiesattr False = a numcopiesattr
- auto numcopiesattr True = do
- needed <- getNumCopies numcopiesattr
- have <- trustExclude UnTrusted =<< Remote.keyLocations key
- if length have `vs` needed
- then a numcopiesattr
- else stop
-
checkAuto :: Annex Bool -> Annex Bool
checkAuto checker = ifM (Annex.getState Annex.auto)
( checker , return True )