aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/diff/ContentSource.java
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2012-03-25 14:42:54 +0200
committerRobin Rosenberg <robin.rosenberg@dewire.com>2012-03-27 00:47:17 +0200
commit3f4725c179c176560937d756682fcd6cfbf685fe (patch)
tree74c5cf2abb65e68d48261da3022c2021b81454f9 /org.eclipse.jgit/src/org/eclipse/jgit/diff/ContentSource.java
parente0531ace35b9c8eca9ded0a7b1540de3c49dbde6 (diff)
downloadjgit-3f4725c179c176560937d756682fcd6cfbf685fe.tar.gz
jgit-3f4725c179c176560937d756682fcd6cfbf685fe.zip
Handle content length in WorkingTreeIterator
Content length is computed and cached (short term) in the working tree iterator when core.autocrlf is set. Hopefully this is a cleaner fix than my previous attempt to make autocrlf work. Change-Id: I1b6bbb643101a00db94e5514b5e2b069f338907a
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/diff/ContentSource.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/ContentSource.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/ContentSource.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/ContentSource.java
index 6fdab6bf89..6e28f854a2 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/ContentSource.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/ContentSource.java
@@ -184,9 +184,10 @@ public abstract class ContentSource {
@Override
public ObjectStream openStream() throws MissingObjectException,
IOException {
+ long contentLength = ptr.getEntryContentLength();
InputStream in = ptr.openEntryStream();
in = new BufferedInputStream(in);
- return new ObjectStream.Filter(getType(), getSize(), in);
+ return new ObjectStream.Filter(getType(), contentLength, in);
}
@Override