support sha256 git repos
Git will eventually switch to sha2 and there will not be one single shaSize anymore, but two (40 and 64). Changed all parsers for git plumbing output to support both sizes of shas. One potential problem this does not deal with is, if somewhere in git-annex it reads two shas from different sources, and compares them to see if they're the same sha, it would fail if they're sha1 and sha256 of the same value. I don't know if that will really be a concern.
This commit is contained in:
parent
b5fc1b97f7
commit
5e4deb3620
15 changed files with 62 additions and 45 deletions
|
@ -216,7 +216,7 @@ mkDiffMap old new db = do
|
|||
, (, (Nothing, Just (Git.DiffTree.file i))) <$> dstek
|
||||
]
|
||||
getek sha
|
||||
| sha == nullSha = return Nothing
|
||||
| sha `elem` nullShas = return Nothing
|
||||
| otherwise = Just <$> exportKey sha
|
||||
|
||||
newtype FileUploaded = FileUploaded { fromFileUploaded :: Bool }
|
||||
|
@ -310,7 +310,7 @@ cleanupExport r db ek loc sent = do
|
|||
|
||||
startUnexport :: Remote -> ExportHandle -> TopFilePath -> [Git.Sha] -> CommandStart
|
||||
startUnexport r db f shas = do
|
||||
eks <- forM (filter (/= nullSha) shas) exportKey
|
||||
eks <- forM (filter (`notElem` nullShas) shas) exportKey
|
||||
if null eks
|
||||
then stop
|
||||
else starting ("unexport " ++ name r) (ActionItemOther (Just (fromRawFilePath f'))) $
|
||||
|
@ -359,7 +359,7 @@ cleanupUnexport r db eks loc = do
|
|||
|
||||
startRecoverIncomplete :: Remote -> ExportHandle -> Git.Sha -> TopFilePath -> CommandStart
|
||||
startRecoverIncomplete r db sha oldf
|
||||
| sha == nullSha = stop
|
||||
| sha `elem` nullShas = stop
|
||||
| otherwise = do
|
||||
ek <- exportKey sha
|
||||
let loc = exportTempName ek
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue