Maybe fix offset incremented at the wrong time.
We need to set offset to the position of the last line if the
content we're pushing ends in '\r'
@@ -697,6 +697,8 @@ class CRDedupeFilePolicy(object):
content.append(line)
chunk_id = self._chunk_id
self._chunk_id += len(content)
+ if content and content[-1].endswith('\r'):
+ self._chunk_id -= 1
return {
'offset': chunk_id,
'content': content
