]> source.dussan.org Git - jgit.git/commit
Fix DiffFormatter for diffs against working tree with autocrlf=true 97/117697/3
authorThomas Wolf <thomas.wolf@paranor.ch>
Mon, 19 Feb 2018 22:42:46 +0000 (23:42 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Wed, 7 Mar 2018 22:25:22 +0000 (23:25 +0100)
commit7d3040368fa8e00c4dfcbd0b7d2d92768cfc2c7e
tree2c5b5372eb0a9e37bc921f66580717821c47e2d3
parent0d79bcf151cb20547ac5899b00db5e7b9246a0d1
Fix DiffFormatter for diffs against working tree with autocrlf=true

The WorkingTreeSource produced an ObjectLoader that returned
inconsistent sizes: the file size in getSize(), but then a
correctly filtered smaller stream in openStream(). This resulted
either in an IOE "short read of block" or in an EOFException
depending on the resulting filtered size.

Fix this by ensuring that getSize() does return the size of the
filtered stream.

Bug: 530106
Change-Id: I7c7c85036047dc10030ed29c1d5a6c7f34f2bdff
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/ContentSource.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java