Split lines in the git-annex branch on \r as well as \n, to deal with \r\n terminated lines written by some versions of git-annex on Windows.
This fixes strange displays in some cases, including whereis showing many duplicate locations, and showing more total copies than actually exist. It's unknown if that lead to data loss when eg, dropping. At the moment, it seems unlikely it could, since the UUID with \r's appended is not the same as a UUID without, and so no remote matches it. It's also unknown if \r's can leak in on windows, perhaps when merging the git-annex branch.
This commit is contained in:
parent
f4db181d9b
commit
eba68572dc
9 changed files with 106 additions and 5 deletions
|
@ -35,6 +35,7 @@ import Common
|
|||
import Types.UUID
|
||||
import Logs.MapLog
|
||||
import Logs.TimeStamp
|
||||
import Logs.Line
|
||||
|
||||
type Log v = MapLog UUID v
|
||||
|
||||
|
@ -50,7 +51,7 @@ parseLog :: (String -> Maybe a) -> String -> Log a
|
|||
parseLog = parseLogWithUUID . const
|
||||
|
||||
parseLogWithUUID :: (UUID -> String -> Maybe a) -> String -> Log a
|
||||
parseLogWithUUID parser = M.fromListWith best . mapMaybe parse . lines
|
||||
parseLogWithUUID parser = M.fromListWith best . mapMaybe parse . splitLines
|
||||
where
|
||||
parse line
|
||||
-- This is a workaround for a bug that caused
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue