This commit is contained in:
Joey Hess 2017-09-06 15:59:02 -04:00
parent 35cd329bd8
commit 4f657ba918
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -49,6 +49,7 @@ optParser _ = ExportOptions
-- An export includes both annexed files and files stored in git. -- An export includes both annexed files and files stored in git.
-- For the latter, a SHA1 key is synthesized. -- For the latter, a SHA1 key is synthesized.
data ExportKey = AnnexKey Key | GitKey Key data ExportKey = AnnexKey Key | GitKey Key
deriving (Show)
asKey :: ExportKey -> Key asKey :: ExportKey -> Key
asKey (AnnexKey k) = k asKey (AnnexKey k) = k
@ -108,7 +109,7 @@ seek o = do
oldtreesha new oldtreesha new
-- Rename from temp to new files. -- Rename from temp to new files.
mapdiff (\diff -> startMoveFromTempName r db (Git.DiffTree.dstsha diff) (Git.DiffTree.file diff)) mapdiff (\diff -> startMoveFromTempName r db (Git.DiffTree.dstsha diff) (Git.DiffTree.file diff))
new oldtreesha oldtreesha new
-- Remove all remaining temps. -- Remove all remaining temps.
mapdiff mapdiff
(startUnexportTempName r db . Git.DiffTree.srcsha) (startUnexportTempName r db . Git.DiffTree.srcsha)
@ -252,8 +253,8 @@ startMoveFromTempName r db sha f
| sha == nullSha = stop | sha == nullSha = stop
| otherwise = do | otherwise = do
ek <- exportKey sha ek <- exportKey sha
stopUnless (liftIO $ elem loc <$> getExportLocation db (asKey ek)) $ do let tmploc@(ExportLocation tmpf) = exportTempName ek
let tmploc@(ExportLocation tmpf) = exportTempName ek stopUnless (liftIO $ elem tmploc <$> getExportLocation db (asKey ek)) $ do
showStart "rename" (tmpf ++ " -> " ++ f') showStart "rename" (tmpf ++ " -> " ++ f')
next $ performRename r db ek tmploc loc next $ performRename r db ek tmploc loc
where where