diff options
author | Joey Hess <joey@kitenet.net> | 2011-03-23 17:29:54 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-03-23 17:29:54 -0400 |
commit | ad08273ac5118f1faac539b53f1fa63908dc5656 (patch) | |
tree | b3bccc405008d7b8a5082e795829617922afb138 | |
parent | 8beb72e20604b0d2cc6359e75ed4eac45fcd1081 (diff) |
refactor
-rw-r--r-- | Command/Migrate.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Command/Migrate.hs b/Command/Migrate.hs index 38dfd06b2..a7014b9bc 100644 --- a/Command/Migrate.hs +++ b/Command/Migrate.hs @@ -31,7 +31,8 @@ start :: CommandStartBackendFile start (file, b) = isAnnexed file $ \(key, oldbackend) -> do exists <- inAnnex key newbackend <- choosebackend b - if (newbackend /= oldbackend) && exists + force <- Annex.getState Annex.force + if (newbackend /= oldbackend || force) && exists then do showStart "migrate" file return $ Just $ perform file key newbackend @@ -59,8 +60,9 @@ perform file oldkey newbackend = do ok <- getViaTmpUnchecked newkey $ \t -> do -- Make a hard link to the old backend's -- cached key, to avoid wasting disk space. - exists <- liftIO $ doesFileExist t - unless exists $ liftIO $ createLink src t + liftIO $ do + exists <- doesFileExist t + unless exists $ createLink src t return True if ok then do |