add: Fix error recovery rollback to not move the injested file content out of the annex back to the file, because other files may point to that same content. Instead, copy the injected file content out to recover.
That was not a data loss, but it came close!
This commit is contained in:
parent
d435a717e6
commit
7938b87864
3 changed files with 11 additions and 16 deletions
|
@ -27,7 +27,6 @@ module Annex.Content (
|
|||
sendAnnex,
|
||||
prepSendAnnex,
|
||||
removeAnnex,
|
||||
fromAnnex,
|
||||
moveBad,
|
||||
KeyLocation(..),
|
||||
getKeysPresent,
|
||||
|
@ -573,13 +572,6 @@ secureErase file = maybe noop go =<< annexSecureEraseCommand <$> Annex.getGitCon
|
|||
boolSystem "sh" [Param "-c", Param $ gencmd basecmd]
|
||||
gencmd = massReplace [ ("%file", shellEscape file) ]
|
||||
|
||||
{- Moves a key's file out of .git/annex/objects/ -}
|
||||
fromAnnex :: Key -> FilePath -> Annex ()
|
||||
fromAnnex key dest = cleanObjectLoc key $ do
|
||||
file <- calcRepo $ gitAnnexLocation key
|
||||
thawContent file
|
||||
liftIO $ moveFile file dest
|
||||
|
||||
{- Moves a key out of .git/annex/objects/ into .git/annex/bad, and
|
||||
- returns the file it was moved to. -}
|
||||
moveBad :: Key -> Annex FilePath
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue