summaryrefslogtreecommitdiff
path: root/Command/DropUnused.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-05-15 02:02:46 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-05-15 02:02:46 -0400
commit56bc3e95cabb85e5f23e30b453f90438c33efbb8 (patch)
treec13ac69cfc2b5ba9582aa5c1ebd427bc0d337b16 /Command/DropUnused.hs
parentb400984ddf9aeb24c3d67e87cfeb29470618636c (diff)
refactor some boilerplate
Diffstat (limited to 'Command/DropUnused.hs')
-rw-r--r--Command/DropUnused.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Command/DropUnused.hs b/Command/DropUnused.hs
index b129235e1..861c78c90 100644
--- a/Command/DropUnused.hs
+++ b/Command/DropUnused.hs
@@ -49,13 +49,13 @@ start (unused, unusedbad, unusedtmp) s = notBareRepo $ search
, (unusedtmp, performOther gitAnnexTmpLocation)
]
where
- search [] = return Nothing
+ search [] = stop
search ((m, a):rest) = do
case M.lookup s m of
Nothing -> search rest
Just key -> do
showStart "dropunused" s
- return $ Just $ a key
+ next $ a key
perform :: Key -> CommandPerform
perform key = do
@@ -64,7 +64,7 @@ perform key = do
Just name -> do
r <- Remote.byName name
showNote $ "from " ++ Remote.name r ++ "..."
- return $ Just $ Command.Move.fromCleanup r True key
+ next $ Command.Move.fromCleanup r True key
_ -> do
backend <- keyBackend key
Command.Drop.perform key backend (Just 0) -- force drop
@@ -75,7 +75,7 @@ performOther filespec key = do
let f = filespec g key
e <- liftIO $ doesFileExist f
when e $ liftIO $ removeFile f
- return $ Just $ return True
+ next $ return True
readUnusedLog :: FilePath -> Annex UnusedMap
readUnusedLog prefix = do