newtype MapLog
Noticed that Semigroup instance of Map is not suitable to use for MapLog. For example, it behaved like this: ghci> parseTrustLog "foo 1 timestamp=10\nfoo 2 timestamp=11" <> parseTrustLog "foo X timestamp=12" fromList [(UUID "foo",LogEntry {changed = VectorClock 11s, value = SemiTrusted})] Which was wrong, it lost the newer DeadTrusted value. Luckily, nothing used that Semigroup when operating on a MapLog. And this provides a safe instance. Sponsored-by: Graham Spencer on Patreon
This commit is contained in:
parent
5d8b8a8ad0
commit
38b9ebc5fd
8 changed files with 74 additions and 44 deletions
|
@ -101,7 +101,7 @@ recordExportUnderway remoteuuid ec = do
|
|||
Annex.Branch.change ru exportLog $
|
||||
buildExportLog
|
||||
. changeMapLog c ep exported
|
||||
. M.mapWithKey (updateForExportChange remoteuuid ec c hereuuid)
|
||||
. mapLogWithKey (updateForExportChange remoteuuid ec c hereuuid)
|
||||
. parseExportLog
|
||||
|
||||
-- Record information about the export to the git-annex branch.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue