fix export overwrite on FAT

Don't accept the cid of the temp file that the content has just been
written to as something we will accept if another file has that same
content. There's no reason to, and on FAT, due to mtime resolution,
the test suite hit just such a case.

This fixes a reversion from 73df633a62
which removed inode from the ContentIdentifier.
This commit is contained in:
Joey Hess 2021-01-25 13:31:17 -04:00
parent 9e1a797fb7
commit b63e3118d7
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 33 additions and 1 deletions

View file

@ -471,7 +471,7 @@ storeExportWithContentIdentifierM dir src _k loc overwritablecids p = do
Nothing -> giveup "unable to generate content identifier"
Just newcid -> do
checkExportContent dir loc
(newcid:overwritablecids)
overwritablecids
(giveup "unsafe to overwrite file")
(const $ liftIO $ rename tmpf dest)
return newcid