eb42935e58
In particular, the mergedrefs file was written with CR added to each line, but read without CRLF handling. This resulted in each update of the file adding CR to each line in it, growing the number of lines, while also preventing the optimisation from working, so it remerged unncessarily. writeFile and readFile do NewlineMode translation on Windows. But the ByteString conversion prevented that from happening any longer. I've audited for other cases of this, and found three more (.git/annex/index.lck, .git/annex/ignoredrefs, and .git/annex/import/). All of those also only prevent optimisations from working. Some other files are currently both read and written with ByteString, but old git-annex may have written them with NewlineMode translation. Other files are at risk for breakage later if the reader gets converted to ByteString. This is a minimal fix, but should be enough, as long as I remember to use fileLines when splitting a ByteString into lines. This leaves files written using ByteString without CR added, but that's ok because old git-annex has no difficulty reading such files. When the mergedrefs file has gotten lines that end with "\r\r\r\n", this will eventually clean it up. Each update will remove a single trailing CR. Note that S8.lines is still used in eg Command.Unused, where it is parsing git show-ref, and similar in Git/*. git commands don't include CR in their output so that's ok. Sponsored-by: Joshua Antonishen on Patreon |
||
---|---|---|
.. | ||
Chunk | ||
ContentIdentifier | ||
Difference | ||
Export | ||
MetaData | ||
PreferredContent | ||
Presence | ||
Remote | ||
SingleValue | ||
Trust | ||
Activity.hs | ||
AdjustedBranchUpdate.hs | ||
Chunk.hs | ||
Config.hs | ||
ContentIdentifier.hs | ||
Difference.hs | ||
Export.hs | ||
File.hs | ||
FsckResults.hs | ||
Group.hs | ||
Import.hs | ||
Line.hs | ||
Location.hs | ||
MapLog.hs | ||
MetaData.hs | ||
Multicast.hs | ||
NumCopies.hs | ||
PreferredContent.hs | ||
Presence.hs | ||
Remote.hs | ||
RemoteState.hs | ||
Restage.hs | ||
Schedule.hs | ||
SingleValue.hs | ||
Smudge.hs | ||
Transfer.hs | ||
Transitions.hs | ||
Trust.hs | ||
Unused.hs | ||
Upgrade.hs | ||
UUID.hs | ||
UUIDBased.hs | ||
View.hs | ||
Web.hs |