From 8cb9381befed4174624edfc80e09185c9340b4f6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 10 Mar 2017 13:12:24 -0400 Subject: AssociatedFile newtype To prevent any further mistakes like 1a497cefb47557f0b4788c606f9071be422b2511 This commit was sponsored by Francois Marier on Patreon. --- Command/Migrate.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Command/Migrate.hs') diff --git a/Command/Migrate.hs b/Command/Migrate.hs index 0ae6f7d80..8dfee9814 100644 --- a/Command/Migrate.hs +++ b/Command/Migrate.hs @@ -73,7 +73,7 @@ perform file oldkey oldbackend newbackend = go =<< genkey go (Just (newkey, knowngoodcontent)) | knowngoodcontent = finish newkey | otherwise = stopUnless checkcontent $ finish newkey - checkcontent = Command.Fsck.checkBackend oldbackend oldkey Command.Fsck.KeyLocked $ Just file + checkcontent = Command.Fsck.checkBackend oldbackend oldkey Command.Fsck.KeyLocked afile finish newkey = ifM (Command.ReKey.linkKey file oldkey newkey) ( do copyMetaData oldkey newkey @@ -86,7 +86,7 @@ perform file oldkey oldbackend newbackend = go =<< genkey next $ Command.ReKey.cleanup file oldkey newkey , error "failed" ) - genkey = case maybe Nothing (\fm -> fm oldkey newbackend (Just file)) (fastMigrate oldbackend) of + genkey = case maybe Nothing (\fm -> fm oldkey newbackend afile) (fastMigrate oldbackend) of Just newkey -> return $ Just (newkey, True) Nothing -> do content <- calcRepo $ gitAnnexLocation oldkey @@ -99,3 +99,4 @@ perform file oldkey oldbackend newbackend = go =<< genkey return $ case v of Just (newkey, _) -> Just (newkey, False) _ -> Nothing + afile = AssociatedFile (Just file) -- cgit v1.2.3