Avoid re-checksumming when migrating from hash to hashE backend. Closes: #774494

This commit is contained in:
Joey Hess 2015-01-04 12:33:10 -04:00
parent e26e26fb32
commit 73928c2274
4 changed files with 15 additions and 6 deletions

View file

@ -72,7 +72,7 @@ perform file oldkey oldbackend newbackend = go =<< genkey
checkcontent = Command.Fsck.checkBackend oldbackend oldkey $ Just file
finish newkey = stopUnless (Command.ReKey.linkKey oldkey newkey) $
next $ Command.ReKey.cleanup file oldkey newkey
genkey = case maybe Nothing (\fm -> fm oldkey newbackend) (fastMigrate oldbackend) of
genkey = case maybe Nothing (\fm -> fm oldkey newbackend (Just file)) (fastMigrate oldbackend) of
Just newkey -> return $ Just (newkey, True)
Nothing -> do
content <- calcRepo $ gitAnnexLocation oldkey