summaryrefslogtreecommitdiff
path: root/Command/Migrate.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/Migrate.hs
parentb400984ddf9aeb24c3d67e87cfeb29470618636c (diff)
refactor some boilerplate
Diffstat (limited to 'Command/Migrate.hs')
-rw-r--r--Command/Migrate.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/Command/Migrate.hs b/Command/Migrate.hs
index 0d21fcbdf..35855d527 100644
--- a/Command/Migrate.hs
+++ b/Command/Migrate.hs
@@ -35,9 +35,8 @@ start (file, b) = isAnnexed file $ \(key, oldbackend) -> do
if (newbackend /= oldbackend || upgradable) && exists
then do
showStart "migrate" file
- return $ Just $ perform file key newbackend
- else
- return Nothing
+ next $ perform file key newbackend
+ else stop
where
choosebackend Nothing = do
backends <- Backend.list
@@ -55,7 +54,7 @@ perform file oldkey newbackend = do
let src = gitAnnexLocation g oldkey
stored <- Backend.storeFileKey src $ Just newbackend
case stored of
- Nothing -> return Nothing
+ Nothing -> stop
Just (newkey, _) -> do
ok <- getViaTmpUnchecked newkey $ \t -> do
-- Make a hard link to the old backend's
@@ -68,5 +67,5 @@ perform file oldkey newbackend = do
then do
-- Update symlink to use the new key.
liftIO $ removeFile file
- return $ Just $ Command.Add.cleanup file newkey
- else return Nothing
+ next $ Command.Add.cleanup file newkey
+ else stop