annex.maxextensionlength

Added annex.maxextensionlength for use cases where extensions longer than 4
characters are needed.

This commit was sponsored by Henrik Riomar on Patreon.
This commit is contained in:
Joey Hess 2018-09-24 12:07:46 -04:00
parent 0f9eafc157
commit 4ecba916a1
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
9 changed files with 48 additions and 16 deletions

View file

@ -65,7 +65,7 @@ upgradableKey backend key = isNothing (keySize key) || backendupgradable
- generated.
-}
perform :: FilePath -> Key -> Backend -> Backend -> CommandPerform
perform file oldkey oldbackend newbackend = go =<< genkey
perform file oldkey oldbackend newbackend = go =<< genkey (fastMigrate oldbackend)
where
go Nothing = stop
go (Just (newkey, knowngoodcontent))
@ -84,7 +84,8 @@ perform file oldkey oldbackend newbackend = go =<< genkey
next $ Command.ReKey.cleanup file oldkey newkey
, error "failed"
)
genkey = case maybe Nothing (\fm -> fm oldkey newbackend afile) (fastMigrate oldbackend) of
genkey Nothing = return Nothing
genkey (Just fm) = fm oldkey newbackend afile >>= \case
Just newkey -> return $ Just (newkey, True)
Nothing -> do
content <- calcRepo $ gitAnnexLocation oldkey