fix false positive in export conflict detection

Like the earlier fixed one in Command.Export, it occurred when the same
tree was exported by multiple clones. Previous fix was incomplete since
several other places looked at the list of exported trees to detect when
there was an export conflict. Added a single unified function to avoid
missing any places it needed to be fixed.

This commit was sponsored by mo on Patreon.
This commit is contained in:
Joey Hess 2019-01-30 12:36:30 -04:00
parent e3dce20cf5
commit ad1d422dd7
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 46 additions and 14 deletions

View file

@ -216,7 +216,7 @@ updateExportTreeFromLog db@(ExportHandle _ u) =
old <- liftIO $ fromMaybe emptyTree
<$> getExportTreeCurrent db
l <- Log.getExport u
case map Log.exportedTreeish l of
case Log.exportedTreeishes l of
[] -> return ExportUpdateSuccess
(new:[]) | new /= old -> do
updateExportTree db old new